Computers and Technology
Computers and Technology, 06.07.2019 11:20, Ruby8342

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?

answer
Answers: 1

Similar questions

Do you know the correct answer?
Import java. util. scanner; public class grade { public static void main (string[] args) { // decla...

Questions in other subjects: