Written Exam


Students will be able to...

  • Recognize vocabulary/concepts from Ch1-5.
  • Declare and assign variables and constants.
  • Define and invoke methods with parameters.
  • Evaluate arithmetic expressions (type and value).
  • Evaluate boolean expressions (value and validity).
  • Predict the output of programs with 2+ methods.
  • Write methods that require I/O and arithmetic.


  • This is a closed-book, closed-notes, no-calculator exam. Do not refer to any materials other than the exam itself. 
  • Do not look at anyone else's exam. Do not talk to anyone but the instructor during the exam. Turn off all cell phones, etc. 
  • Use the restroom and take care of personal needs before you arrive. If you need to leave during the exam, ask for permission. 


Coding Exam


Students will be able to...

  • Meet any objectives from PA1 and PA2.
  • Perform integer division and modulus.
  • Invoke methods from the Math class.
  • Write properly constructed methods with parameters and return values.


  • You must use a Linux lab machine and log in with your JMU account (not student). It's strongly recommended that you practice the sample exam in the lab so there will be no surprises on Friday. 
  • This is a closed book exam and during the exam, you may only use the provided exam reference sheet and no other materials.
  • You may only run the following programs: JGrasp/DrJava (or other simple editor - no Eclipse), a terminal, meld (or other diff tool), and a web browser. All windows should be arranged so that the instructor can see what you're doing. 
  • The use of any pre-existing code (other than that provided as part of the exam), other documents/pages/sites, and/or other programs will be considered a violation of the Honor Code. 
  • At the end of the exam, you will submit your code via Webcat. You may not use Canvas for any other purpose (e.g., looking at sample solutions to prior labs) during the exam.

CHAO - Practice Coding Exam

Here is a coding practice portion for Exam 1 that I have developed.  Read through the specification and code an AddHours.java file.  I've created a practice submission in Webcat for you to test against.

Below you will find two other sets of Practice Exams, the first is one from Dr. Bernstein and the second a past exam from Dr. Mayfield.

 Bernstein Practice Exams:

For Q7 of the written sample Dr. Bernstein's class uses the JMUConsole class instead of some of the following standard classes: printf() and Scanner Class.  He has noted differences in that question.  


Similarly for Question 2 of the Coding portion sample the JMUConsole class is again used by Dr. Bernstein's class.  You may note the difference and apply the changes needed to work with standard Java System.out and Scanner classes.

so Question 2 above code snippet becomes:
    import java.util.Scanner;

        public class Inspector {

    public static void main(String[] args) {
       double        adjusted, co, particulates;       
       int           age;       

       Scanner in = new Scanner(System.in);       
       System.out.printf("Age: ");
       age = in.nextInt();
       System.out.printf("Carbon Monoxide: ");
       co = in.nextDouble();
       System.out.printf("Particulates: ");
       particulates = in.nextDouble();


Mayfield Practice Exams:

As a reminder, the midterm will consist of two parts (50 minutes each): a written exam portion, and a coding exam portion. You are encouraged to study all previous activities and labs, textbook chapters and reading quizzes, and programming assignments. You may use the following materials as help for the exam.  These are not necessarily a full coverage of exam topics or official point by point study guide but should be helpful in reviewing for and getting a feel for the time constraint for the exam written and coding portions.  

 Sample Written Exam (Fall 2015)

 Sample Coding Exam (Fall 2015)     test1.in     test1.exp     test2.in     test2.exp

Video walkthrough from Dr. Mayfield for this example

If you have questions about the material - post in Piazza under exam1 heading.

Back to Top