CentralLink Central Mi × Laos PS 180 Pnnop × / Lab2-Easic Interact e x n ps lack
ID: 3876385 • Letter: C
Question
CentralLink Central Mi × Laos PS 180 Pnnop × / Lab2-Easic Interact e x n ps lackboard cric × z central Michigan un e x chegg Study Guded-x Chegg Stuoy Gu ded x > C à Secure https:/ olackboard.cmichedu/bbcswebdav pid 5513623 dt content rid 43748886 1/courses/CPS180 18500 2234274 1/Lab2 Basic%20Interactive%20Program.pdf Apps Hornel Central Mich zy Central Michigan Uni Fantasy Fcotball 20. Hormel Cheggeum : Lab2-Basic Interactlve Program.pdf 113 a semester ree exams: mid-term exam 1, mi term exam 2, and final exam. Now you want to find out what's the average grade a student got from these three exams. The basic steps in this task would be: 1. In the same project Lab2B, create a new class named "GradeAverager 2. Start coding the following basic steps: Ask grades for each exam (you may ask one by one, or three at once), then read in data and store them; Calculate average grade, Display the grades for each exam and the average grade. a. b. c. Simulate the following interaction: 09/13/2017 CPS180 iling Li Please enter grades for midterm exam 1, 2, and final exam, in order: 82.5 90 99.6 idterm 1: 82.50 idterm 2: 90.00 Final exam: 99.60 The average grade is 9e.7e Reminders O Type here to search 1124 AM 1/18/2018Explanation / Answer
import java.util.Scanner;
public class GradeAverage {
public static void main(String[] args) {
Scanner sc=new Scanner(System.in);
double mid1,mid2,finalSem;
System.out.println("Please enter grades for midterm exam 1 ,2 and final exam, in order");
mid1=sc.nextDouble();
mid2=sc.nextDouble();
finalSem=sc.nextDouble();
System.out.println("Midterm 1:"+mid1);
System.out.println("Midterm 2:"+mid2);
System.out.println("Final exam:"+finalSem);
double avg=(mid1+mid2+finalSem)/3.0;
System.out.println();
System.out.println("The average Grade is :"+avg);
}
}
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.