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
The editing of digital photos us about the same level of difficulty as editing an analog photo
Answers: 2
question
Computers and Technology, 23.06.2019 14:30
Which of the following would not be considered a pc? a. mainframe b. desktop c. tablet pc d. laptop
Answers: 2
question
Computers and Technology, 23.06.2019 16:00
Helen is having a meeting with her colleagues in her company. they are working on the goals and objectives for the coming year. they want to ensure that these goals and objectives of the processes involved are properly evaluated. which system can helen and her colleagues apply to evaluate this? helen and her colleagues require a blank to evaluate the goals and objectives.
Answers: 2
question
Computers and Technology, 23.06.2019 19:00
This question involves a class named textfile that represents a text file. public class textfile { private string filename; private string filename; private arraylist words; // constructors not shown // postcondition: returns the number of bytes in this file public int filesize() { } // precondition: 0 < = index < words.size() // postcondition: removes numwords words from the words arraylist beginning at // index. public void deletewords(int index, int numwords) { } // precondition: 0 < = index < = words.size() // postcondition: adds elements from newwords array to words arraylist beginning // at index. pub lic voidaddwords(int index, string[] newwords) { } // other methods not shown } complete the filesize() method. the filesize() is computed in bytes. in a text file, each character in each word counts as one byte. in addition, there is a space in between each word in the words arraylist, and each of those spaces also counts as one byte. for example, suppose the words arraylist stores the following words: { mary had a little lamb; its fleece was white as snow. } the filesize() method would compute 4 + 3 + 1 + 6 + 5 + 4 + 6 + 3 + 5 + 2 + 5 as the sum of the lengths of each string in the arraylist. the value returned would be this sum plus 10, because there would also be 10 spaces in between the 11 words. complete the filesize() method below: // postcondition: returns the number of bytes in this file public int filesize() { }
Answers: 1
You know the right answer?
Import java. util. scanner; public class grade { public static void main (string[] args) { // decla...
Questions
question
Mathematics, 04.11.2020 18:20
question
Geography, 04.11.2020 18:20
question
Mathematics, 04.11.2020 18:20
question
Mathematics, 04.11.2020 18:20
Questions on the website: 13722363