Question

In: Computer Science

Write a Java program that outputs the output below Student Name: Andrew Johnson Course: Biology 101...

Write a Java program that outputs the output below

Student Name: Andrew Johnson
Course: Biology 101

Quiz Average and percent weight (separated by a space): 87 15
Project Average and percent weight (separated by a space): 92 25
Exam Average and percent weight(separated by a space): 85 40
Final Exam and percent weight (separated by a space): 83 20

Final Grade in Biology 101 for Andrew Johnson is 86.7

The largest average was 92
The smallest average was 83

Thank you for using my grade program!!

Solutions

Expert Solution

import java.util.Scanner;

public class GradeProgram {

    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        System.out.print("Student Name: ");
        String name = in.nextLine();
        System.out.print("Course: ");
        String course = in.nextLine();
        System.out.print("Quiz Average and percent weight (separated by a space): ");
        int quiz = in.nextInt();
        int quizPercentage = in.nextInt();
        System.out.print("Project Average and percent weight (separated by a space): ");
        int project = in.nextInt();
        int projectPercentage = in.nextInt();
        System.out.print("Exam Average and percent weight (separated by a space): ");
        int exam = in.nextInt();
        int examPercentage = in.nextInt();
        System.out.print("Final Exam and percent weight (separated by a space): ");
        int finalExam = in.nextInt();
        int finalExamPercentage = in.nextInt();
        double total = ((quiz*quizPercentage)+(project*projectPercentage)+(exam*examPercentage)+(finalExam*finalExamPercentage))/100.0;
        System.out.println("Final Grade in " + course + " for " + name + " is " + total);
        System.out.println("The largest average was " + Math.max(Math.max(quiz, project), Math.max(exam, finalExam)));
        System.out.println("The smallest average was " + Math.min(Math.min(quiz, project), Math.min(exam, finalExam)));
        System.out.println("Thank you for using my grade program!!");
    }
}


Related Solutions

Write the following java program: Desc Output the name and time of the runner who came...
Write the following java program: Desc Output the name and time of the runner who came in first, as well as the name and time of the runner who came in last in a marathon race (assuming there are no ties). Input A text file named marathon.txt containing the name and time of each participant in the following format (the file has at least 1 participant, name is just 1 word with no space, and name and time are separated...
For each problem below, write a java program to solve it, name your programs as PA2_1.java...
For each problem below, write a java program to solve it, name your programs as PA2_1.java and PA2_2.java. 1. We have a steam heating boiler whose bursting pressure is known, but we of course want to use it only at pressures well below this limit. Our engineers recommend a safety factor of 3; that is, we should never exceed a pressure that is one-third of the rated bursting pressure. Write a java program that reads in the rated bursting pressure...
Write a machine language program to output your name on the output device. The name you...
Write a machine language program to output your name on the output device. The name you output must be longer than two characters. Write it in a format suitable for the loader and execute it on the Pep/9 simulator. my name is Kevin
Write a program to take input of scores for Chemistry, Biology and English for a student...
Write a program to take input of scores for Chemistry, Biology and English for a student and display the average with 2 decimal places if all of the three scores are in the range between 1 and 100 inclusive. Program should also display the course name for which scores are entered out of range telling Average couldn't be calculated. Following is a sample run: Enter scores for Chemistry, Biology and English between 1 and 100: 45 89 96 Avg score...
Write a Java program for RSA encryption that has the following inputs and outputs: Given a...
Write a Java program for RSA encryption that has the following inputs and outputs: Given a message and an integer n = pq where p and q are odd primes and an integer e > 1 relatively prime to (p − 1)(q − 1), encrypt the message using the RSA cryptosystem with key (n, e).
Write a Java program that prompts a user for 10 integers. When completed it outputs the...
Write a Java program that prompts a user for 10 integers. When completed it outputs the highest number, the lowest number, the number of odd number, and the average of the numbers
Create the following java program with class list that outputs: //output List Empty List Empty List...
Create the following java program with class list that outputs: //output List Empty List Empty List Empty Item not found Item not found Item not found Original list Do or do not. There is no try. Sorted Original List Do There do is no not. or try. Front is Do Rear is try. Count is 8 Is There present? true Is Dog present? false List with junk junk Do or moremorejunk do not. There is no try. morejunk Count is...
Write a program that will calculate numerical and letter grades for a student and output a...
Write a program that will calculate numerical and letter grades for a student and output a report: The information will be in the provided data file studentGrades.txt. The data file consists of several rows of data containing a student name and information for 3 types of assignments: First Name, Last Name, number of homework grades, values for homework grades, percentage of total grade, number of program grades, values for program grades, percental of total grade, number of ex-am grades, values...
Write a program that will calculate numerical and letter grades for a student and output a...
Write a program that will calculate numerical and letter grades for a student and output a report: The information will be in the provided data file studentGrades.txt. The data file consists of several rows of data containing a student name and information for 3 types of assignments: First Name, Last Name, number of homework grades, values for homework grades, percentage of total grade, number of program grades, values for program grades, percental of total grade, number of ex-am grades, values...
Write a C++ program that outputs a histogram of student Marks for a Mid-term-1 Examination. The...
Write a C++ program that outputs a histogram of student Marks for a Mid-term-1 Examination. The program should input each student’s Marks as an integer and store the Marks in a dynamic array. Marks should be entered until the user enters -1 for marks. The program should then scan through the Dynamic array and compute the histogram. In computing the histogram, the minimum value of a marks is 0 but your program should determine the maximum value entered by the...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT