QuestionQuestion

Rule 1: Naming is an important issue in Java. Not only you need to define meaningful variable names, but also have to give appropriate names for the physical java file, which should be the same as your public class name that you edit.
Unless otherwise mentioned, you will follow the industry standard for Java naming convention:
(1) Java Classes start in uppercase and each individual word in the class name is capitalized;
(2) All Java methods and variables start in lowercase and each individual word in the method and variable is capitalized;
(3) Each final variable (known as a constant) should be written in all uppercase.

Rule 2: There should be a space around all operators (e.g., 3 + 5, not 3+5). In addition, spacing with regards to parentheses should be consistent.

Rule 3: In addition to the Java naming convention, you are asked to add your name in front of each class name like LastNameFirstNameClassName.java.
For instance, if your name is “John Doe” and the class name is “RightTriangle”, then your class name in your source code should be “DoeJohnRightTriangle” and your corresponding physical file name should be “DoeJohnRightTriangle.java”.

Rule 4: Everything nested inside of an open brace should be indented with regular-sized spaces (say, 4 or 8 spaces). The open brace for functions and classes should (1) come at the end of the line and be preceded by a space like

public class DoeJohnRightTriangle {
public static void main() {}
}

or (2) start with the new line as shown below:

public class DoeJohnRightTriangle
{
public static void main() {}
}

Question 1: Course Grade Calculator

The following is the grading policy given in syllabus:   

Assignments: Students will be required to complete five programming assignments. Students will be given two weeks to complete each assignment. Four of the assignments will count towards the final grade, giving student the option to drop their lowest graded assignment.

Exams: Three exams, including the final exam, will be given. Students will be given at least one weeks notice of the exam dates. All examinations are written examinations and students are required to provide their own College Blue books for each exam. There are no make-up examinations available for any student. If a student has an excused absence exam, the grade he/she receives from the next exam will be counted for both.


Grading plan:
Assignments 20%
First exam 15%
Second exam 20%
Lab        20%
Final exam 25%

>= 90 A
>= 80 but < 90 B
>= 70 but < 80 C
>= 60 but < 70 D
< 60 F

Write a java program to help students to calculate his/her grade. The program will prompt user for the following inputs: assignment grades, 2 exam grades, a lab grade, and a grade of the final exam. It then calculates the weighted average and print on the screen both this value and a letter grade the student will receive. Your program should work for as many students as what user needs. The following is the sample screen display where the user inputs are underlined.   

Please enter 5 assignment grades: 80 85   65   85   90
After the lowest grade is dropped, your assignment average is 85.0
Please enter 2 exam grades: 70 80
Please enter the lab grade: 100
Please enter the grade of your final exam: 70

The weighted average is:
85.0 * 20% + 70 * 15% + 80 * 20% + 100 * 20% + 70 * 25% = 81.0
You will receive B.

Do you want to calculate for another student? Please type true or false. true
Please enter 5 assignment grades: …
… // screen display for the next student

Do you want to calculate for another student? Please type true or false. false
Bye, bye!

The class that you will be writing will be called LastNameFirstNameCalculateGrades.java.

Solution PreviewSolution Preview

This material may consist of step-by-step explanations on how to solve a problem or examples of proper writing, including the use of citations, references, bibliographies, and formatting. This material is made available for the sole purpose of studying and learning - misuse is strictly forbidden.

public class NewMain {

    public static void main(String[] args) {
      
       Scanner keyboard = new Scanner(System.in);
      
       int [] grades = new int[5];
       String continues = "true";
       double average;
       int examGrade1;
       int examGrade2;
       int labGrade;
       int finalExamGrade;
       double weightedAverage;
      
       /// looping intil continues is different to true
       while (continues.equals("true")) {            
            
            // get assingment grades
            System.out.print("Please enter 5 assignment grades: ");            
            for (int i = 0; i < 5; i++) {
                grades[i] = keyboard.nextInt();
            }
            
            // calculte average of assignemt grades
            average = getAverage(grades);
            // print it out
            System.out.println("After the lowest grade is dropped, your assignment average is " + average);...
$15.00 for this solution

PayPal, G Pay, ApplePay, Amazon Pay, and all major credit cards accepted.

Find A Tutor

View available Java Programming Tutors

Get College Homework Help.

Are you sure you don't want to upload any files?

Fast tutor response requires as much info as possible.

Decision:
Upload a file
Continue without uploading

SUBMIT YOUR HOMEWORK
We couldn't find that subject.
Please select the best match from the list below.

We'll send you an email right away. If it's not in your inbox, check your spam folder.

  • 1
  • 2
  • 3
Live Chats