CS 140 - Homework 8 - Due March 5


Reread pages 19-28 on Java basics.

In this homework we're going to write a simple Java program to calculate your current average in this course and then print it as a percentage. You should be keeping track of how many labs and homeworks you have completed and the grade earned. If you have not been keeping track start today. Send me an e-mail asking for the info if you don't have it. You program and main class should be named HW8.

  1. Declare an appropriately typed variable named hw_avg to hold your current homework average. We have had seven homeworks to date. Give yourself zero points if you didn't turn an assignment in, one point for a check minus, and two points for a check. That implies the total number of possible homework points to date is 14. Print your home workaverage nicely as a percentage. For example
    		Homework average is 85%. 
    		
  2. Declare a vaiable lab_avg and calculate your lab average and then print a nice message.

    We have had eleven labs to date. You get two free attendance/lab misses in this class. Give your self one point for a completed lab, and 1.5 points for a lab done with extra credit. Here are some examples:

  3. Calculate your exam average. We have had one exam and one quiz with a total of 124 points. If you had a 16 on the quiz and an 75 on the exam then your exam average is (16 + 75)/124 or 73%.
  4. Now compute your overall class average and print it. Recall from the syllabus that exams and quizzes are worth 60% of your grade, in class labs are 20% and HW is 20%. Print a nice message that says what your overall average is. For example:
    My class average is 82%
    

Example output

Your program's final output should look something like

Homework average is 75%
Lab average is 98%
Exam average is 90%
Overall average is 88.6%

What to turn in

  1. Turn in a prinout of your program with your name on it.
  2. e-mail me your program as an attachment with the subject heading CS140 HW 8.