Tina Comston
Comp-111 Exam 1
Franklin University
Exam 1
Exam - to be taken during Week 6
  • Proctor
    • All proctor information should have been received at this point.  The Testing Center will be contacting each proctor to ensure that the email addresses are all functional.  
  • Preparing for the exam
    • Review the readings for Weeks 1 - 4.
    • Review the Key Points for Modules 1 - 4.
  • Exam Format
    • Paper and Pencil exam, no book, no notes
    • 11 multiple choice questions (3pts each)
    • 7 True/False (2pts each)
    • 14 short answer/coding questions (various point assignments)
    Exam Practice Questions  
    • Chapter 1
      •  Describe the various operations performed by the CPU.
      •  Describe the different between primary and secondary storage.  Be able to provide an example of each.
    •  What is an algorithm?
    •  What is psuedo code?
      • Describe both syntax and logic errors.
      • What are the operations performed by the central processing unit (CPU)?
      • What are the two most important benefits of the Java language?
      • What is the file extension for a java source file?  What is the file extension for a compiled java file? How do you compile/call a java executable from the command line?
      • What will be the output of the following statements:
        • String firstWord = "Hello!";
        • String secondWord = "Study";
        • String thirdWord = "hard.";
        • String newSentence = firstWord + secondWord + thirdWord;
        • System.out.println(newSentence);
      • Evaluate the following code:
        • String firstWord = "Hello!"
        • secondWord = "Study";
        • String thirdWord = "hard.";
        • String newSentence = firstWord & secondWord + thirdWord;
        • System.out.println(newSentence);
    • Identify the syntax errors.  (There are 3.)
    • Identify the logic errors. (There are 2.)
      • What is the difference between the System.out.println() and System.out.print() methods?
    • What is the purpose of a compiler?  a processor?
    • Chapter 2
      • Describe the purpose of a constructor.  What is the difference between a default constructor and an explicit constructor?  What return type is specified for a constructor?
      • Given the following definition statements for constructors - create a new object instance.
        • public Dog()
        • public Car(String inMake, String inColor, int inMPG)
        • public House(double inLatititude, double inLongitude, String inColor)
    • Evaluate the following statement:
      • myAccount.deposit(payCheck);
        • Identify the object(s), method(s), parameter(s)
        • How many total parameters (implicit and explicit) are there?
        • Is there an implicit parameter? If yes, what is it?
        • Is there an explicit parameter(s)?  If yes, what is it?
      • What makes a valid Java identifier?
      • What are the primitive data types in Java?
      • Which variable type would be used for the following data?
        • GPA
        • name
        • age (in years)
        • batting average
        • football score
        • customer address
    • Consider the following java code:
      • Car newCar1 = new Car("Chevy", "Blue", 32);
      • Car newCar2 = new Car(newCar1);
      • How many objects are created? 
      • Are the instance variables referred to by newCar1 the same as the instance variables referred to by newCar2?
    • Consider the following java code:
      • Car newCar1 = New Car("Chevy", "Blue", 32);
      • Car newCar2 = newCar1;
      • How many objects are created?
      • Are the instance variables referred to by newCar1 the same as the instance variables referred to by newCar2?
    • Evaluate the following statement:
      • public void deposit( double inAmount)
        • Is this an accessor or mutator method?  How can you tell?
        • Does this method return a value?  If yes, what type is the return value?
        • Does this method accept explicit input parameters?  If yes, what type(s) is the parameter(s)?
      • What will be the output of the following:
        • System.out.print("COMP");
        • System.out.println("111");
        • System.out.print(" is a ");
        • System.out.println("great class.");
    • Reviewing each of the following variable names - do any of them violate Java syntax?  violate Java convention?
      • tmpStation
      • return
      • noMore? 
      • TmpStation 
    • Chapter 3
      • Describe abstraction, encapsulation, information hiding, and black box.
      • What is a unit test?
      • What are javadocs?  How is a javadoc created?  What parameters can be specified for a javadoc? 
      • What is a local variable?  What is the lifetime of a local variable?
      • How is an implicit parameter denoted within a class?
    • How many parameters, both implicit and explicit are in the following statements, assuming String tmpString = "Hello Class!; ?
      • String newString = tmpString.substr(1, 3);
      • String upperString = tmpString.upperCase();
      • boolean isEqual = tmpString.equals("Hello Class!");
    • What are the basic steps for testing a method?   How do you write an assert statement to test a method that returns an integer value?  a double value?  a string value?
    • Chapter 4
    • Evaluate the following statement, assuming that initially a = 10 and b = 11.
      • c = a + b++;
      • What will a be equal to after this statement is executed?
      • What will b be equal to after this statement is executed?
      • What will c be equal to after this statement is executed?
      • Describe final and static with regards to defining variables.
      • Define a constant variable with a name of MINS_PER_HR set equal to the value 60.
      • What is an instance variable?  Should an object be manipulated by directly accessing its instance variables? What is the lifetime of an instance variable?
    • What will be the result of the following equation?
      • 3 + (4 % 2) - 6 / 4
    • Assuming that you need to generate a class and objects to represent the following - what class would be needed and how many objects should be created of each.
      • orange - 15 oranges
      • banana - 10 bananas
      • papaya - 5 papayas
    • Evaluate each of the following statements and determine the number type.  Will the statement successfully compile?
      • int tmpNum = 40;
      • double tmpNum = 40.0;
      • int tmpNum = 40.0;
      • double tmpNum = 40;
    • Consider the following equation:
      • double battingAverage = 2.81;
      • int avgRounded = battingAverage;
      • What value will avgRounded contain?  Or will an error result?