This study guide includes everything from the test one study guide.
You do not have to look at that separate web page. It is all included here.


CS 1160 Final Exam Study Guide
Monday, May 2nd, 2016
1-2:50 pm


  1. FINAL EXAM is at 1-2:50 pm on Monday May 2nd.

  2. FINAL EXAM STUDY GUIDE: Practice, practice, practice, think, think, think, remember the last 3 letters of the word thINK are INK. It is ten times more effective to WRITE with pen or pencil when you are studying and trying to learn. BICTION. Write, write, write.

  3. Simulate test conditions. Practice without looking at notes, then grade your own answer as to what was correct and what you did not get right and how you will remember next time what you forgot when writing code or answering questions.

  4. February 29th TEST ONE: 1160TestOne.pdf... Practice by taking this first test again several times and getting 100% on it.
    SASP, write complete program to get a sum, Draw flow chart (page 233),
            I P and O and problem solving VET, swap(num1, num2);
                      write the function named factorial(), 
                                   Bubble Sort - page 468 of textbook
    
  5. Page 19 of the textbook, Figure 1-9 of the textbook was also handed out on the first day of class: 1160handout1.pdf ...
        "The steps listed in Figure 1-9 emphacize the importance of planning.
         Just as there are good ways and bad ways to paint a house, 
         there are good ways and bad ways to create a program.
         A good program always begins with planning."      
    

    First day of class handout: 1160handout1.pdf ...

  6. Step #1 of Figure 1-9 is to "Clearly define what the program is to do."

    What are the four things you must identify in this first step, according to the textbook (and page 19 handout)?

  7. Figure 1-9 lists 9 different steps. List the first four steps (of the nine steps).

  8. Handout: Problems Solving and Resist the Urge to Code. The 9 steps from textbook. Pages 19-22 carefully explained and connected to the 5 step model emphacized in class throughout the semester. Ghostbusters metaphor.

  9. Understand the Rectangle class. Use this modified example from the textbook: rectanglesChap13.cpp ...
    jacobson[weblab]:~/web/cpp$ ./a.out
    
    This program will calculate the area of a rectangle.
               What is the width? 12  
              What is the length? 21
    
    Here is the rectangle's data:
                           Width: 12
                          Length: 21
                            Area: 252
    
  10. Here is an even easier version of the Rectangle class to study in preparing for the OOP and Chapter 13 portion of the test:

                Rectangle class VIP: rectanglesChap13simplerYet.cpp ...

                Note: This version is very useful if you are having trouble with trivia.cpp assignment!

    jacobson[weblab]:~/web/cpp$ g++ rectanglesChap13simplerYet.cpp 
    jacobson[weblab]:~/web/cpp$ ./a.out
    
    Let's calculate the area of a rectangle:
    
                          What is the width? 12      Using the two public MUTATOR member functions
                         What is the length? 21             to change the PRIVATE member variables.
    
    Here is the rectangle's data:
                                      Width: 12      Using the three public ACCESSOR member functions
                                     Length: 21             to access the information that the object
                                       Area: 252            has stored or can calculate for us from
                                                            from what is stored.
    
  11. Know the concept of the STRUCT from chapter 11. Page 496 has an example of a Payroll sruct with five different members. A struct cannot have any member functions! A class allows member functions. Review your array of structs examples and assignment.
    struct polyTerm
    {
       double coef;       // coefficient of a polynomial term
       int exponent;      // exponent of the polynomial term
    };
    
           polyTerm poly[20];    // array that can hold up to 20 polynomial terms...
    

  12. Write a for loop statement and the body of the for loop to print out the up to 100 different 3 or 4 or 5 digit auto part numbers that are stored in an array named autoParts that has been declared with:
       int autoParts[100], 
                 numParts, 
                        i;
    
       Assume that numParts is the variable containing the actual number of 
            automobile part numbers that are in the array autoParts[].
    
            So, for example, numParts might be 88 or 70 or 55 or 93 or 20 or 16.
                             --------          --    --    --    --    --    --
    
       You should output 8 parts per line and have them nicely line up in 
                         8 different columns so they are easily readable.
    
       Example:  (Where numParts was 30, i.e. there were 30 auto parts)
    
        2579    1234     222   98700    2323   55555   33333     777   
         111     223   44444     321    6050    5060     888   34567
       98210   10000    2000    2001    2002     375   35000    5001
        1616    1717    2016    1010    2016   1205
    
  13. Write a for loop statement to print out the numbers 1 to 20.

  14. What does the acronym VET stand for in the set of acronyms VET SAT AUC TVV SO YMDC?

  15. What does the acronym AUC stand for in the set of acronyms VET SAT AUC TVV SO YMDC?

  16. What does the four letter acronym acronym YMDC stand for in the set of acronyms VET SAT AUC TVV SO YMDC?

  17. VET SAT AUC, TVV SO YMDC quote by Edsgar W. Dijkstra. 18 word summary of programming and problem solving.

  18. If we change YMDC to YMTC, where the T stands for TWO, what are the main TWO that are to be kept VV S (VV from TVV and S from SO).

  19. Fill in the blank: The proverb of all programming proverbs, which really is also a general problem solving proverb applying to many things besides programming and computers is:
    
     ------------------  --------------  ------------------ --------------  ------------
    
     Fill in the FIVE words of the programming proverb on the lines above please.
    
  20. What does the acronym SASP stand for? Fill in the four blanks with the four words please.

  21. Arguments passed by value and by reference = Function (II)

    Study pages 47-49 of The C++ Language Tutorial. Understand the different ways for passing arguments to function. INPUT and OUTPUT and INPUT/OUTPUT or IN and OUT and IN/OUT were discussed on 2/22/16 Monday.

  22. From week #1: I P O and why I O first and then P second. See item #8.
    Why does focus on WHAT precede the focus on HOW? What is I? What is O? What is P?
    See LI List Item #8 on week1.html to review IPO and resisting the urge to code.

  23. Figure 5-1: Draw the flow chart for the logic of a while loop. Page 233 of textbook (and handout).

  24. Convert the while loop to a for loop. Convert the for loop to a while loop.

  25. Page 294, Programming Challenge #1 - write the program that can find the sum of the integers 1, 2, 3, ..., n where n is a positive integer that is entered by the user of your program.
    See #5, #6, and #7 for the Solution and more importantly the process of arriving at it.

  26. Print out the numbers 1, 2, 3, 4, ..., 99, 100 by printing exactly 10 numbers per line. Use either a for loop or a while loop to do it.
    See ASCII characters example for 16 per line: Printing 32 thru 47, 48 thru 63, 64 thru 79, ..., 112 thru 127 would be SASP.

    Note: See also the PRIME number program primes3.cpp for another example for how to print 10 numbers per line of output.

  27. ...

  28. ...

  29. ...

  30. ...