Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //MAIN ASSIGNMENT 1
- import java.io.*;
- import static java.lang.System.*;
- import java.util.Scanner;
- class Main{
- public static void main (String str[]) throws IOException {
- Scanner scan = new Scanner (System.in);
- System.out.println("Please enter your test grades.");
- System.out.print("Test 1: ");
- double test1 = scan.nextDouble();
- System.out.print("Test 2: ");
- double test2 = scan.nextDouble();
- System.out.print("Test 3: ");
- double test3 = scan.nextDouble();
- System.out.println();
- // System.out.println("Test 1: " + test1 + "\n" + "Test 2: " + test2 + "\n" + "Test 3: " + test3);
- System.out.println("Please enter your quiz grades.");
- System.out.print("Quiz 1: ");
- int quiz1 = scan.nextInt();
- System.out.print("Quiz 2: ");
- int quiz2 = scan.nextInt();
- // System.out.println("Quiz 1: " + quiz1 + "\n" + "Quiz 2: " + quiz2);
- System.out.println();
- System.out.println("Please enter your homework average.");
- System.out.print("Homework: ");
- double hwAvg = scan.nextDouble();
- // System.out.println("Homework: " + hw);
- System.out.println();
- double testAvg = ((test1 + test2 + test3)/3);
- System.out.println("Test Average: " + testAvg);
- double quizAvg = (double)(quiz1 + quiz2)/2;
- System.out.println("Quiz Average: " + quizAvg);
- double finalGrade = hwAvg*.25 + testAvg*.4 + quizAvg*.35;
- System.out.println("Final Grade: " + finalGrade);
- scan.close();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement