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

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 11:00
Lisa’s company, abc ltd., lost its biggest client and is now facing a financial crunch. most of her colleagues have resigned, but lisa decides to stay with the company and assist the management in overcoming the financial situation. which quality is lisa demonstrating? a. self-management b. cooperativeness c. responsibility d. loyalty
Answers: 2
question
Computers and Technology, 23.06.2019 04:00
In a word processing program, such as microsoft word, which feature to you choose the desired picture enhancement?
Answers: 2
question
Computers and Technology, 23.06.2019 05:20
What did creator markus “notch" persson initially call his game
Answers: 1
question
Computers and Technology, 24.06.2019 00:10
Read each statement below. if the statement describes a peer-to-peer network, put a p next to it. if the statement describes a server-based network, put an s next to it. p - peer-to-peer s - server-based
Answers: 1
You know the right answer?
Import java. util. scanner; public class grade { public static void main (string[] args) { // decla...
Questions
question
Social Studies, 04.02.2020 02:56
Questions on the website: 13722361