You are on page 1of 4

Final Exam

Review
The Final Exam will be made up of 100 multiple choice and true/false questions. Unless mentioned otherwise, the question is, what does the code display to the screen? Unless specified otherwise, all code snippets are assumed to run, i.e., there are no syntax errors. Research and study the following in order to prepare for the Final Exam: General: o What are the good practices for problem solving? Choose variable names carefully Develop the solutions progressively Compile frequently and isolate compiler errors Use the debugger to find logic error, because the program cannot hide anything from you Etc. o What is an IPO diagram? Be able to recognize one o What are test cases? Why use them? Should you use them? o Know the basic Code Conventions, i.e., lining up braces, indenting, naming conventions, etc. o Evaluate snippets of code to determine the output or if there is some kind of problem, e.g., infinite loop, run-time error, etc. o Evaluate code to determine what, if anything, is wrong with it o Given a scenario, be able to recognize the correct code, which accomplishes the scenario o Given output, what is the matching code to produce it o Given a code snippet, pick the best choice explaining what it does in English o Understand where an items definition must be in relation to when the item gets used o How do you determine, which data type to use? What needs to be represented? What size does it need to be? o What constitutes a valid name, i.e., syntax, naming conventions, etc.? o What is a constant? How and where do we traditionally define one in C? According to the Code Conventions, what is the correct format for the name Can it be changed during execution? o Put the basic primitive data types in order from smallest to largest, i.e., char, short, int, long, float, and double o What is the char data type? What is its size?

o o o o

o o o o o o

o If-elses: o Evaluate if-else constructs o Nested vs. stacked Switches: o What are the parts? o Which parts are optional? o Does each case need to be unique? o What is the default case? o What does fall through or bleeding mean? o Why use the break; statement? When would you use it? When dont you need to use it? Is it always required or sometimes optional? o How does its condition differ from the one for an if construct?

What does it have to do with ASCII? What type of data type is it, e.g., integer, floating-point, etc.? What does the unsigned modifier do a data type? With which data types can you use it? What is the sizeof operator? Why would you use it? What are the 7 short-cut operators? What is the purpose of the break; statement? When should it be used? When should it be avoided? When is it considered bad programming? Be able to match the % modifier for the scanf() with its matching data type, i.e., %c = char, %i = int, %f = float, and %lf = double Evaluate conditions containing relational and logical operators What does short-circuit mean? Which operators use it? What are the different types of errors? What is a database? How can you create the equivalent of one in C? Determine the number of kilobytes used to store data, e.g., What is the total size, given the following about a database: (Answer: 1 KB) It is made up of 2 records, which is made up of: an array of 103 integers an array of 100 characters An integer is 4 bytes A character is 1 byte 1 kilobyte = 1024 bytes Be able to convert from one number system to another, e.g., a simple hexadecimal to a decimal number What is an object?

o Loops: o Evaluate the different types of loops, i.e., while, do-while, and for o What are the similarities and differences, e.g., which one executes the statements inside the loop at least once? o Pretest vs. post-test o When would you use the loops, e.g., which loop would you typically use to process an array, use for counter control, sentinel control, etc.? o Which loop is useful once you learn the status of the stop condition in the body of the loop, e.g., during event-driven programming such as when processing the option chosen off a menu? Arrays: o What is an array, i.e., collection, same data type, etc.? o How can you initialize on array using braces, i.e., {}, for loop, etc.? o Determine the index of an array given an elements value o Determine the value of an arrays element given the index o What is the common for loop definition for processing, e.g., displaying, all the elements of an array o What are parallel arrays? What are their characteristics and how do they relate, e.g., size? Together would they be considered a type of database? o Two-dimensional arrays: Whats another way to refer to one? How would you visually represent one? A matrix? A table? A spreadsheet? Functions: o Why do we use functions? Repetition? Divide and conquer? o What is a hierarchy chart and why would you use one? o What does API mean? o How would you use the IPO type comments, which are above a function header, along with the function header as documentation for an API, see the Code Conventions? o What is the difference between a predefined, e.g., printf(), and a user-defined function o What is a function header? o What are the parts of a function header, i.e., return-type, name as a verb, parentheses, parameter list, etc.? o What is a parameter list vs. argument list? o What is a function call?

When would you use if-else constructs vs. switch constructs, e.g., which one would more likely be used to evaluate a range of values? Be able to convert a switch into if-else constructs, and vice versa

o o o o

What is a prototype? What are the similarities and differences between a function definition, prototype, and function call? Understand where a functions definition or prototype must be in relation to when the function gets called What is scope? When does it begin and end? When can variables have the same name? When can they not have the same name? How many things can be returned from a function using the return keyword?

As always, if you have any questions, search the Q & A, or post a new question there.

You might also like