if(qtySold > QUOTA)
bonusPay = 50;
totalPay = regPay + bonusPay;
System.out.println("Your totalPay amount is " + totalPay);
?
Why is the above code incorrect? Write the code that will provide the correct result.
What will be an ideal response?
When you place a block within anifstatement, it is crucial to place the curly braces correctly. In the above code, the curly braces have been omitted. WhenqtySold > QUOTAis true,bonusPayis calculated and theifexpression ends. The next statement that computestotalPayexecutes every time the program runs, no matter what value is stored inqtySold. ?if(qtySold > QUOTA){ bonusPay = 50; totalPay = regPay + bonusPay;}System.out.println("Your totalPay amount is " + totalPay);?
You might also like to view...
What information must you have available when trying to save a configuration from the router to a TFTP server?
a. Privileged EXEC mode password b. Name of the configuration file c. Address of the TFTP server d. Both a and c
A secret key for symmetric encryption that is generated for use for a short period of time is called a _________ .
A. strategic key B. sequence key C. session key D. stream key