Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

You will write a Java class called Grades that should be saved into a file called Grades.java. Your program will read in grades for a

You will write a Java class called Grades that should be saved into a file called Grades.java.

Your program will read in grades for a student in a fictional course, and it will calculate the overall course grade for the student. Below is one example log of execution of the program (user input is underlined for the sake of clarity in the log --- you do not need to duplicate this behavior).

an example run of the program

This program accepts your homework and two exa m scores as input and computes your grade in the course.

Homework weight? 50

Exa m 1 weight? 20

Using weights of 50 20 30

Homework:

Number of assignments? 10

Average Homework grade? 8.45

Number of late days used? 2

Labs attended? 4

Total points = 100.5 / 140

Weighted score = 35.89

Exa m 1:

Score? 81

Curve? 0

Total points = 81 / 100

Weighted score = 16.2

Exa m 2:

Score? 95

Curve? 10

Total points = 100 / 100

Weighted score = 30.0

Course grade = 82.09

The course grade is a weighted average of three components: a homework grade, an exa m 1 grade, and an exa m 2 grade. To compute a weighted average, the student's point scores for each component are divided by the total points for that component and multiplied by that component's weight.

The homework score is determined by the student's average score on a series of assignments, as well as points for attending labs. Homeworks are worth 10 points, and each lab is worth 4 points, and the number of homeworks and labs is the same. The number of assignments is entered by the user, as is the student's average homework score and the number of labs attended, as shown in the execution log. If a student hands an assignment in late, he or she uses "late days." For this course, if the student uses more late days than half the number of assignments, the assignment grade should be reduced by 10%. If the student uses no late days, the student should get 5 extra credit points for the homeworks. However, a student cannot earn more points than the maximum available for homeworks; a student that averages 10 points per assignment and never hands any in late has already earned the maximum number of homework points and will get no extra credit for being punctual.

Exa ms are worth 100 points each, and potentially are curved by adding some "curve points" to every students' grade. However, students cannot earn more than 100 points on an exa m.

Your program should be careful to correct bad numeric values entered by the user. If a user enters a negative number or zero for the number of assignments, the student should get full credit for the homework grade. If a user enters a negative number for the average homework grade or an exa m grade, it should be treated like a zero. If a user enters a higher score than the maximum number of points available for homeworks or an , the score should be capped.

In the log of execution shown, the course has 50% weight for homework, 20% weight for exa m1, and 30% weight for exa m 2. There are 10 homework assignments. The student attended 4 labs (earning 16 points for doing so). The student received an exa m 1 score of 81. The student earned an exa m 2 score of 95; the exa m was curved by +10 points, but exa m scores are capped at 100, so the student was given 100 for exa m 2.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database And Transaction Processing

Authors: Philip M. Lewis, Arthur Bernstein, Michael Kifer

1st Edition

0201708728, 978-0201708721

More Books

Students also viewed these Databases questions