Spring 2002 Test #2 Review Page

CSE1320 Sections 003 and 501                                                                   Dr. Tiernan’s sections

Topics to be covered on Test #2 with accompanying notes:

 

Main Topics                                                           Test #2 is IN CLASS Thursday, February 28th

Scope

            Be able to determine the scope of a variable

            Know how to make a variable global or local

Function Declarations

            Be able to interpret declarations including pointers

Pointers to Function

            Definitions of pointers

            Pointer variables

            Pointers as return types

Two-D Arrays

            Understand how C treats a 2-D array as “an array of arrays”

            Know how to access array and array elements with pointer arithmetic and array subscripts

Multi-Dimensional Arrays

            Know how to use the correct indexes to reach the value you want

            Know what the first two indexes represent

Double Indirection

            Understand how to declare a pointer to a pointer

            Understand what each level of dereferencing points to

Command Line Parameters

            Know what the two parameters are

            Know how to use them

            Know how C will store the parameter data

Files

            Know how to connect a physical file to a variable in your program

            Know how to indicate the way the file will be used (for reading, etc.)

Reading in Data

            Know the syntax and parameters for the following

            Chars – getc, putc

            Strings – fgetc, fputc

            Blocks – fread, fwrite

            Formatted – fscanf, fprintf

            Random Access – fseek, ftell

 

Secondary Topics

Storage Class

            know the storage classes and their characteristics and scope

            make distinction between uses of static

Function Parameters

            Passing parameters vs. global parameters

            Function return type

Conditional expression

Arrays as Parameters

            Know how to pass arrays

 

 

Test will have some or all of the following characteristics:

            multiple choice questions (not more than 10) – typically 1 to 2 points each

            short answer questions

            coding questions which require either

                        writing code or

                        interpreting code or

                        debugging code

                  ( “code” includes declarations, preprocessor directives, function definitions and

                  general coding of statements and control structures and I/O commands)

            matching questions

            fill-in-the-blank questions

      Questions generally have their point value listed in braces at the end/side of the question

      Every test will have at least 10 points worth of extra credit available

      Assume that you will need to analyze each question carefully. Almost every question has multiple levels of definition and you must read and understand ALL parts of the question in order to give the complete and correct answer.

 

      Assume that memorization is not enough. Two study suggestions are the following.

1)   Pick a program that is coded in the book. Do NOT read any of the text before or after the program. By reading only the code itself, try to figure out everything that the code does. This means that you must determine the purpose and function of the OVERALL program not just what each line does individually. After you think you have it all figured out, then read the text to see if you were correct and if you missed any actions that occur in the code.

2)   Pick an exercise from the end of the chapter of the type that says “You are an ---- for company X and you have to write a program to . . .” Given the information in the exercise, try to create the outline of the program, what subfunctions you would want to create, what type of data is passed around, what input and output are needed. Make sure that each of your planned functions has a unified single purpose and that the code to implement it would not have to be very long.

      These two types of study will help you practice analyzing code and analyzing problems to be coded.

 

Test grades are assigned on a curve based on the range of actual scores on the test, i.e. the highest score on the test (for example, an 89) will be the top of the curve so all scores will be assigned based on where they fall (100 – 90 A, 89 – 80 B, etc.) AFTER the actual score has been divided by the curve.

 

The test will be hard. I write very challenging questions that require you to think all the way through them. A few of the questions will be memory type questions because some rules must be memorized to make a student an efficient programmer in a language. Most however will require lots of mental effort. Do not get too upset about it – remember EVERYONE is suffering through the same test you are and that everyone’s grade will be curved. Check out my website for a few example test questions from last semester’s tests. They will give you a sense of how my tests are written.