CS 130 Computing Concepts -- Final Review, Spring 2011


How to prepare for the exam

  1. Reread this
  2. Redo the labs (if you do not remember how their content)
  3. Make sure you can answer the sample questions below
  4. Get plenty of sleep the night before (it's hard to think when you are overtired).
  5. Make sure you can answer the questions on the second review sheet!

Disclaimers

  1. Not all these questions will appear on the exam.
  2. Not all the exam questions appear here.

Sample questions:

  1. Problem solving
    1. When do you engage in problem solving (problem solving as defined in the context of this class)?
    2. What are 6 problem solving techniques we have covered in class?
    3. Which of those are specific to programming/computing?
    4. Why does each technique help? Arguments based on human cognitive characteristics will receive full credit.
  2. Algorithms
    1. What is the definition of an algorithm?
    2. Why is a recipe typically not an algorithm?
    3. What is the relationship between a program and an algorithm?
    4. Why is it so difficult to write a program to do something you don't understand?
  3. Design
    1. What are the two steps to designing a GUI program?
    2. Why is design important?
    3. How are design and debugging related?
    4. Why might you do two different designs before committing to code?
  4. File systems
    1. What app do you use to find files/directories on a Mac?
    2. What is a file?
    3. What is a directory?
    4. What is the complete path to your home page (assuming you are on a Mac in the lab using the Finder)?
    5. What is the complete path to your home page (assuming you are in China using a browser).
    6. How many subdirectories may a directory have?
    7. What's wrong with this web path? http://willamette.edu/~jstudent/public_html/MyEditor/dist/launch.jnlp
  5. Programming in Java
    1. What are variables used for? How do you declare a variable? How many values does a variable have? How do you set the value of a variable?
    2. Name 2 types you have used.
    3. What are 4 Java instructions we have used?
    4. If you want to do one of two things, what construct do you use?
    5. To repeat a section of code, what construct do you use?
  6. Things mathematical
    1. What is the definition of the natural numbers?
    2. What is a prime number?
    3. Conceptually, what is the different between base 10 and base 2?
    4. Why are numbers whose digits sum to 9 always divisible by 9?
  7. Sample programming questions
    1. Write a complete Ruby instruction to double the number of coins on her current corner if there is currently an odd number there, or, pick them all up if there is an even number there. Assume there are no walls nearby, and that she has enough coins in her bag to do the doubling.
    2. Assume there is a global variable, named sum. Write a complete method to add one to it.
    3. Assume there are global variables, named sum and currentNum. Write a method to sum them and store the result in sum.
    4. Assume there is a global int variable, currentInput. Write a method, setCurrentInput(), to set that variable to the int corresponding to the String in a TextField named inTF.
    5. Assume you have TextFields named inTF, and maxTF, and a method, setCurrentInput() which sets a global int variable, currentInput from inTF. Fill in this method so that as the user types a series of numbers in inTF displays the biggest number they have typed in outTF.
          private void inTFActionPerformed(java.awt.event.ActionEvent evt) {
      
      
      
          }
                              
    6. Just like the previous, but display the average of all the numbers they have typed.
    7. Assume you are writing an editor. If the user has opened a file, say, /Volumes/homes/cs130/testProject/foo.java, when they say "save" (so to speak), your program should simply save that file; on the other hand if they have created a new file and save it, your program should prompt them for where to save it. Write a method that both of these "saves" can use. Add global variables as necessary.