Summer 2002 Test #2 Review Page

CSE1320 Section 501                                                                                        Dr. Tiernan’s section

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

 

Main Topics                                                                         Test #2 is IN CLASS Monday, July 15

Control Structures

      do-while

      switch

            syntax of cases

Recursion

      concept

      implementing recursion

            base case(s)

            recursive calls

      recursion vs. iteration

            cost / benefits

Structures

            creating data types

            declaring variables

            accessing members

            assignment of whole structures and of member value

            bit field members

                        defining

                        addressable boundaries

Enumerated types

            integer constants

            use in switch / benefits

Unions

            many members like a structure

            only one valid member at a time

            data in a member is only meaningful to a single member

            up to programmer to distinguish meaning

Storage Classes of Variables

            know the storage classes and their characteristics and scope

            make distinction between uses of static

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

 

 

 

 

Secondary and Related Topics

Control Structures

      flow of control

            continue, break

            return, exit()

            goto

Functions

            know the rules for creating

                        function prototype declarations

                        function definitions

            understand the use of function parameters including void

                        know call-by-reference and call-by value

 

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. For example, a high score of 89 would give that student an A because 89/89 100 = 100. On the same test then, a score of 68 would be curved as 68/89*100 = 76 so that student would get a C (rather than a D for the original 68).

 

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.