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, 21.06.2019 22:00
3. (6 pts) internally in the computer, with few exceptions, all numerical computation is done using binary numbers. output, however, often uses ascii, which is formed by appending 011 to the left of a bcd code. thus, an algorithm that directly converts a binary integer to a bcd integer is very useful. here is one such algorithm 1) draw lines to the left of the binary number to bound the expected bcd decades. (each decade is a group of 4 bits.) move the binary number one bit to the left. add 0011 to each bcd decade containing a binary value> 0100 repeat steps 2-3 until the last bit in the binary number has been moved into the least significant decade position. (note that when the last bit has been shifted into bcd decade, step 3 is not repeated.) read the bcd result. 2) 3) 4) 5) a) execute the algorithm for the binary number 1101101 b) execute the algorithm for the binary number 01110101110 4. (4 pts) represent the decimal number 3568 in bcd; excess-3 code; ascil; and hex.
Answers: 1
question
Computers and Technology, 22.06.2019 03:00
Check my work the microprocessor is a(n) circuit, which is designed to process data based on a set of instructions. most desktop and laptop devices contain a microprocessor based on the standard. most tablets and smartphones contain processors based on technology. a microprocessor's circuitry is designed to perform a limited number of tasks contained in its set. during processing, an instruction is loaded into the processor's unit. data is loaded into registers in the processor's where arithmetic and logic operations are performed. microprocessor performance can be measured by its speed. other factors affecting overall processing performance include word size, cache size, and instruction set complexity. most digital devices contain only one microprocessor chip, but today's multi- processors contain circuitry that supports parallel processing. computers contain various kinds of memory. random memory is a special holding area for data, program instructions, and the system. it stores data on a temporary basis until the processor makes a data request. ram is different from disk storage because it is , which means that it can hold data only when the computer power is turned on. computers also contain read- memory, which is a type of non-volatile memory that provides a set of "hard-wired" instructions, called the loader, that a computer uses to boot up.
Answers: 3
question
Computers and Technology, 22.06.2019 07:50
In this lab, you complete a prewritten c++ program for a carpenter who creates personalized house signs. the program is supposed to compute the price of any sign a customer orders, based on the following facts: the charge for all signs is a minimum of $35.00. the first five letters or numbers are included in the minimum charge; there is a $4 charge for each additional character. if the sign is made of oak, add $20.00. no charge is added for pine. black or white characters are included in the minimum charge; there is an additional $15 charge for gold-leaf lettering. instructions ensure the file named housesign.cppis open in the code editor. you need to declare variables for the following, and initialize them where specified: a variable for the cost of the sign initialized to 0.00 (charge). a variable for the number of characters initialized to 8 (numchars). a variable for the color of the characters initialized to "gold" (color). a variable for the wood type initialized to "oak" (woodtype). write the rest of the program using assignment statements and ifstatements as appropriate. the output statements are written for you. execute the program by clicking the run button. your output should be: the charge for this sign is $82. this is the code, // housesign.cpp - this program calculates prices for custom made signs. #include #include using namespace std; int main() { // this is the work done in the housekeeping() function // declare and initialize variables here // charge for this sign // color of characters in sign // number of characters in sign // type of wood // this is the work done in the detailloop() function // write assignment and if statements here // this is the work done in the endofjob() function // output charge for this sign cout < < "the charge for this sign is $" < < charge < < endl; return(0); }
Answers: 1
question
Computers and Technology, 22.06.2019 14:10
Dean wants a quick way to look up staff members by their staff id. in cell q3, nest the existing vlookup function in an iferror function. if the vlookup function returns an error result, the text “invalid staff id” should be displayed by the formula. (hint: you can test that this formula is working by changing the value in cell q2 to 0, but remember to set the value of cell q2 back to 1036 when the testing is complete.)
Answers: 3
You know the right answer?
Import java. util. scanner; public class grade { public static void main (string[] args) { // decla...
Questions
question
French, 08.03.2021 21:30
question
Mathematics, 08.03.2021 21:30
question
Mathematics, 08.03.2021 21:30
question
Geography, 08.03.2021 21:30
question
Mathematics, 08.03.2021 21:30
Questions on the website: 13722360