Final Exam Guide CS15900 PDF

Title Final Exam Guide CS15900
Author Rick2021thebest
Course Programming Applications For Engineers
Institution Purdue University
Pages 4
File Size 104.9 KB
File Type PDF
Total Downloads 110
Total Views 169

Summary

Final Exam Guide CS15900: reviewing for the final...


Description

CS 159 Final Exam Review Guide On campus version: Wednesday 8:00am – 10:00am in LWSN B151 Distance education version: Exam will be available Wednesday at 8:00am – Thursday at 11:00pm. The Basics: • 150 points possible. 2-hour time limit. Format too be determined. The Material: • The exam is cumulative, but the emphasis will be on the material introduced since the midterm exam (chapter 4 and beyond). • There will only be a few questions on MATLAB. What to Review: • Lab and homework assignments from this semester. Lab quizzes too! • The book (use the on-line discussions to guide you through the topics found in the text). • Problems at the end of each chapter in the book. Chapter 4 • What is a module? What is the top-down design? What is factoring? How are these ideas related to user-defined functions and solving more complex computer programming problems? • How does the use of a structure chart relate to factoring and the top-down design of a solution to a programming problem? • What is a called function (module)? What is the calling function (module)? What is parameter passing? • How can you best describe the purpose of the main function in a C program? How is the main function more than just the place where the program begins execution? • What are some advantages to using functions (153-154 C text)? • What are the four basic designs of user-defined functions (section 4.3 C text)? • What is a function definition? What are the parts of every function? Function header (both as described on page 162 and the documentation requirement)? Function body (recall the two sections of every function in a C program from chapter 2)? Formal parameter list? Local variables? • What is a function declaration (prototype)? Where do these go in your program? • What is a function call? • What is a function prototype (declaration)? What is required of a function prototype? What can optionally be placed in a function prototype? Where were all function prototypes placed this semester? • How are the calls, prototypes, and the function headers different? How are they similar? • What is inter-function communication? How are downward and upward communication related to pass by value and pass by address (the books calls this pass by reference)? • What is true about the number of values that can be returned from a function using the keyword return? • What is a pointer variable? What is the indirection operator? What is the address operator? How do you use pointer variables to scan a value into the memory that a pointer references (think back to how you have used passed by address with input functions in the programs you have written)? • What is scope? • Review Section 4.8. There is some good information here on structure charts and functional cohesion that summarize this chapter well.

End of Chapter 4 Problems • 15, 16, 18 – Review of the requirements of a function definition (actual code of the user-defined function). • 19 – Good review of the requirements of function prototypes. • 20 – Good review of the requirements of function calls. Chapter 5 (begins on page 231 of the C text) • What is logical data? Why is true = 1 and false = 0 an incomplete definition of true and false values in C? • What are the logical operators? How are they used? • How are logical operators evaluated? How do you know if x && y || z is the same as (x && y) || z or x && (y || z)? How does operator precedence (inside cover of your C text) have to say regarding these operators? • How is the syntax of the logical operators in C the same as in MATLAB? How is it different? • What is the short-circuit method of evaluating and/or expressions? • What are the relational operators? What is the complement of a given logical expression? • What is two-way selection? How is two-way selection implemented in C? • What is a conditional expression? • What are the course standards as they relate to the if/else construct? • What is multi-way selection? How is this implemented in C? • What does the break do in a switch statement? What are the course standards as they relate to control forcing statements such as break? • What are the switch statement rules? End of Chapter 5 Problems • 15, 17, 18, 20 – Review the evaluation of logical and relational expressions. • 20 – 29 – Test the code as it appears in the text. Observe the output. Modify the code to meet course standards such that it still produces the same output as the original code. • 30 – 32 – Review of switch statements. Chapter 6 (begins on page 303 of the C text) • Know the basic terms related to repetition: loop iteration, loop control expression, loop initialization, loop update, and loop control variable. • What is the difference between a pretest and post-test loop? What does this mean in regards to the minimum number of iterations? When would one select a pretest construct instead of a post-test construct? • What is a loop control variable? What is loop initialization? What is a loop update? How are these things related? Include the loop control expression as well. • What are event-controlled and counter-controlled loops? Give an example of each. • Compare each of the loops in the C language: while, do-while, and for. What three expressions come together to form a for loop in C? How does this differ from the construct by the same name in MATLAB? How can a for loop be converted to a while loop? • What is a nested loop? Be able to interpret a nested loop. • What is an infinite loop? • What is input validation? • What is recursion? How do recursive function calls stop? Under what conditions should recursion be used? Be able to read a program that utilizes recursion. • When is it appropriate to use recursion? • What are the course standards as they relate to control-forcing statements such as break?

End of Chapter 6 Problems • 5 – 12 – Each is a review of basic looping terminology. • 15 – 30 – Test the code as it appears in the text. Observe the output. Modify the code to meet course standards such that it still produces the same output as the original code. ◦ Do not worry about EOF loops (21b, 23b). Chapter 7 – File I/O • How to declare a file pointer? • How to use fopen, fscanf, fprintf, and fclose? • How are symbolic constants used to represent file names with fopen? • When is the right time to use fclose? • What does the value returned from the fscanf function represent? • How does one search for the end of a file? • What are the different modes for opening a file? • How do you determine if a file opened as expected? • In what order is data read from a file? How do you skip over data in a file? • Why are file pointer values returned from a “file open” function? Are file pointers passed to a function by address or by value? • What is redirection? • How do you redirect input? output? append output? • Try writing the following programs for practice: (page 454 – 21, 22, 27) Chapter 8 – Arrays • What is an array? • What is an array element? How are individual elements accessed? • How can scanf be used in association with a loop to place values in an array? • What does the name of an array represent? How can the elements of an array be printed to the monitor? • How are array elements passed to a function? Is this done by value or by address? • How is an entire array passed to a function? Is this done by value or by address? • How are two elements of an array exchanged (for example, in the bubble sorting algorithm)? • What is index range checking? Who is responsible for index range checking? What may happen as a result of accessing an index that is beyond the defined bounds of an array? • How are arrays indexed? What does the index of an element have to do with the name of the array and the memory assigned to that array? • How are arrays initialized? What happens when the number of elements initialized is less than the size of the array? • Know each of the sorting algorithms discussed in class. You only need to know the logic and how an array in the process of being sorted would progress in a given algorithm. Be able to solve problems similar to those seen on page 543-545 (#19 - #24 and #27) of the text. • Know each of the searching algorithms discussed in class. What are the requirements for each algorithm? When does one perform better than the other? Be able to solve problems similar to those seen on page 544 (#25 and #26) of the text. • What is a multidimensional array? How are they defined? How can you determine the total number of elements that a multidimensional array can store? • How is a two dimensional array initialized? How can you assign a value to a particular element in a two dimensional array?

Chapter 11 – Strings • What is a string? • What is “variable” about a variable-length string? What does a delimiter character have to do with variable-length strings? • How can printf and scanf be used with strings? What problem with scanf can be fixed by using gets? • Know the three functions from string.h discussed in class (strlen, strcpy, strcmp). Chapter 9/10 – Pointers and Pointer Applications • Understand passing parameters by address (primarily from chapter 4). See sections 9-1 and 9-2 in chapter 9. Older Material: MATLAB • Be able to read MATLAB code including selection and repetition. Problem Solving • Know the symbols and expectations of a flowchart. • Know what goes on a structure chart and how it is represented. Chapter 2 – Introduction to the C Language • What are the components of a C program? (notes page 103) • What is true regarding each of these components (notes page 104). • What are the course standards regarding identifiers? What are the requirements of the language for an identifier? • What is determined by the data type of a variable? • What does it mean to initialize a variable? What is the default value for an uninitialized variable in C? • What is a literal constant? What is a symbolic constant? When should one use a symbolic constant? How should symbolic constants be named (see course standards)? • What are the components of a printf? scanf? • What are the types of errors? When are each observed? How does a given error effect the programming process? Chapter 3 – The Structure of a C Program • What is operator precedence? • What is a compound assignment expression? Develop some examples similar to those found on page 119 of your notes to determine how compound assignment expressions are interpreted. • What are the prefix and post-fix increment (and decrement) operations? How are they similar? How are they different? When are these operations undefined? • What is a mixed type expression? How are these expressions evaluated? • What is an implicit type cast? What is an explicit type cast?...


Similar Free PDFs