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 in Java that reads in a set of positive integers and outputs how...
Write a program in Java that reads in a set of positive integers and outputs how many times a particular number appears in the list. You may assume that the data set has at most 100 numbers and -999 marks the end of the input data. The numbers must be output in increasing order. For example, for the data 15 40 28 62 95 15 28 13 62 65 48 95 65 62 65 95 95 -999 The output is...
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
Using Java Write a program that reads a file of numbers of type int and outputs...
Using Java Write a program that reads a file of numbers of type int and outputs all of those numbers to another file, but without any duplicate numbers. You should assume that the input file is sorted from smallest to largest with one number on each line. After the program is run, the output file should contain all numbers that are in the original file, but no number should appear more than once. The numbers in the output file should...
Using Java Write a program that reads a file of numbers of type int and outputs...
Using Java Write a program that reads a file of numbers of type int and outputs all of those numbers to another file, but without any duplicate numbers. You should assume that the input file is sorted from smallest to largest with one number on each line. After the program is run, the output file should contain all numbers that are in the original file, but no number should appear more than once. The numbers in the output file should...
Write a java program MyCalendar that outputs a monthly calendar for a given month and year....
Write a java program MyCalendar that outputs a monthly calendar for a given month and year. the output should be looks like this one at the bottom:( I don't know why it doesn't show right but the first day of the month is not Sunday it starts from Wednesday) F. Last’s My Calendar Enter month year? 10 2019 10/2019 Sun Mon Tue Wed Thu Fri Sat --------------------------------- 1 2 3 4 5 6 7 8 9 10  11 12 13 14...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT