subject

Import java. util. scanner; public class grade { public static void main (string[] args) { // declare constants final double in_weight = 0.6; // in-class weight is 60% final double out_weight = 0.4; // out-of-class weight is 40% // declare variables int prelabpts; //number of points earned on the pre-lab assignment int prelabmax; //maximum number of points possible for pre-lab int labpts; //number of poitns earned on the lab int labmax; //maximum number of points possible for lab int postlabpts; //number of points earned on the post-lab assignment int postlabmax; //maximum number of points possible for the post-lab int outclassavg; //average on the out of class (pre and post) work int inclassavg; //average on the in-class work double labgrade; //final lab grade scanner scan = new scanner(system. in); // get the input system. out. println("\nwelcome to the grade calculator\n"); system. out. print("enter the number of points you earned on the pre-lab: "); prelabpts = scan. nextint(); system. out. print("what was the maximum number of points you could have earned? "); prelabmax = scan. nextint(); system. out. print("enter the number of points you earned on the lab: "); labpts = scan. nextint(); system. out. print("what was the maximum number of points for the lab? "); labmax = scan. nextint(); system. out. print("enter the number of points you earned on the post-lab: "); postlabpts = scan. nextint(); system. out. print("what was the maximum number of points for the post-lab? "); postlabmax = scan. nextint(); system. out. println(); // calculate the average for the out of class work outclassavg = (prelabpts + postlabpts) / (prelabmax + postlabmax) * 100; // calculate the average for the in-class work inclassavg = labpts / labmax * 100; // calculate the weighted average taking 40% of the out-of-class average // plus 60% of the in-class labgrade = out_weight * outclassavg + in_weight * inclassavg; // print the results system. out. println("your average on out-of-class work is " + outclassavg + "%"); system. out. println("your average on in-class work is " + inclassavg + "%"); system. out. println("your lab grade is " + labgrade + "%"); system. out. println(); } } can anyone fix this code?

ansver
Answers: 1

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 13:00, mariahrpoulin9630
Which part of the cpu accepts data?
Answers: 1
image
Computers and Technology, 22.06.2019 21:00, depression4eternity
The average cost of one year at a private college in 2012-2013 is $43,289. the average grant aid received by a student at a private college in 2012-2013 is $15,680.   what is the average student contribution for one year at a private college in 2012-2013?
Answers: 3
image
Computers and Technology, 23.06.2019 01:30, marmar72
Negative methods of behavior correction include all but this: sarcasm verbal abuse setting an example for proper behavior humiliation
Answers: 1
image
Computers and Technology, 23.06.2019 12:00, muncyemily
From excel to powerpoint, you can copy and paste a. cell ranges and charts, one at a time. b. cell ranges and charts, simultaneously. c. charts only. d. cell ranges only.
Answers: 3
You know the right answer?
Import java. util. scanner; public class grade { public static void main (string[] args) { // decla...

Questions in other subjects:

Konu
History, 26.03.2021 17:00