Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

At the end of the semester, students always want to know what they will need to get on the Last Test to get a certain

At the end of the semester, students always want to know what they will need to get on the Last Test to get a certain grade for the course. What they would like is a program that will calculate what score they will need to get to receive that grade i.e. A, B, C...

So we are going to write a program that will get 3 regular scores from the student - Quiz average, Assignment average, and Project average. The course grade is calculated off of a weighted average where each of these averages is worth 20% of the grade and the Last Test is worth 40%. Your program must allow the user to enter what grade they are interested in and be given what score they need on the Test to get that grade.

  • If they would have to get a score of over 100 then you must tell them they can not get that grade.
  • Likewise if they would have to get a negative score then you tell them they don't even have to take the Test to get that grade.
  • Other wise give them the minimum score that they will need to receive the grade they want.
  • Also they must be able to choose which grade they are interested from a menu where the last choice is to stop.

_________________________________________________________________________________________________________________

They liked our program so much that they determined that they wanted it expanded so they could see what they needed for all their classes.

Our mission now is to make it so that the user can enter data for all classes and see what they might need for a score on the Last Test to get a particular letter grade in each course they are taking.

What this means is that we need to make a copy of Assignment 2 and modify it to meet some additional requirements which some of them are as follows:

  • They must be able to have a way to let the program know that they don't have another class to record
  • They must give the name of the class i.e. CS II
  • They must give all information for each class before moving on.
  • They must give the output after all information is received and all calculations are done.
  • You must use a 2-dimensional array to store all the scores
  • The menu must be a separate method
  • Calculating what the Last Test needs to be must be a separate method that receives access to a 1-dimensional array and returns the score.
  • All classes' scores are the same and calculated the same.
  • The order that data is entered matters
    • menu choice
    • class name
    • 3 scores
    • ask if they have another class (enter 1 for yes and 0 for no)
  • cannot use a global variable
  • the switch menu statement must be in a different method
  • have a separate menu that receives access to the 1-D array and returns the score (can override for each row)

here is the program that I need to change to the correct format... if you could help me I would really appreciate it!

import java.util.Scanner;

public class FinalExam { public static void main(String[] args){ // declaring all variables Scanner in = new Scanner (System.in); int choice; double quiz; double asign; double project; double Final = 0; double current; double grade; char letterGrade = 'A'; // displaying the menu System.out.println("Please enter your choice of grade"); System.out.println(); System.out.println("1.\t A: 90-100"); System.out.println("2.\t B: 80-89.9"); System.out.println("3.\t C: 70-79.9"); System.out.println("4.\t D: 60-69.9"); System.out.println("5.\t F: 0-59.9"); System.out.println("6.\t You would like to exit the program"); //getting users choice choice = in.nextInt(); // Displaying choice switch (choice) { case 1: System.out.println("You selected, A"); Final = 90; letterGrade = 'A'; break; case 2: System.out.println("You selected, B"); Final = 89.9; letterGrade = 'B'; break; case 3: System.out.println("You selected, C"); Final = 79.9; letterGrade ='C'; break; case 4: System.out.println("You selected, D"); Final = 69.9; letterGrade = 'D'; break; case 5: System.out.println("You selected, F"); Final = 59.9; letterGrade = 'F'; break; case 6: System.out.println("Exiting the program"); System.exit(0); System.out.println("Ending the program"); break; default: System.out.println("invaild choice"); } //getting grades from student to claculate the final grade System.out.println("Please enter your Quiz average"); quiz = in.nextDouble(); System.out.println("Please enter your Assignment average"); asign = in.nextDouble(); System.out.println("Please enter your Project average"); project = in.nextDouble(); //doing the math for the final grade current = (.20 * asign + .20 * quiz + .20 * project); grade = (Final - current) / .40;

// output if (grade > 100){ System.out.println("You would need to make over 100 to pass the class for an " + letterGrade); }else if (grade <= 0){ System.out.println("You do not have to take the final to get that grade to get a " + letterGrade); }else { System.out.printf("To make a " + letterGrade + " in the class, you at least need to make a: %.3f ", grade); } } }

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 Technology And Management Computers And Information Processing Systems For Business

Authors: Robert C. Goldstein

1st Edition

0471887374, 978-0471887379

More Books

Students also viewed these Databases questions

Question

. Question 3 of 7 Answered: 1 week ago

Answered: 1 week ago