Question

if(qtySold > QUOTA) bonusPay = 50; totalPay = regPay + bonusPay; System.out.println("Your totalPay amount is "...

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.

0 0
Add a comment Improve this question Transcribed image text
Answer #1

if(qtySold > QUOTA){

bonusPay = 50;

totalPay = regPay + bonusPay;

System.out.println("Your totalPay amount is " + totalPay); ​

}

Just adding the { to complete the code inside the if condition

Add a comment
Know the answer?
Add Answer to:
if(qtySold > QUOTA) bonusPay = 50; totalPay = regPay + bonusPay; System.out.println("Your totalPay amount is "...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • (dollars per gallon) Production ...quota - ES 10 20 0 e 30 40 50 60 Quantity...

    (dollars per gallon) Production ...quota - ES 10 20 0 e 30 40 50 60 Quantity (thousands of gallo S 4) Based on the figure above, a. What is the free-market equilibrium price? b. What is the price after the government starts implementing the production quota? c. What is the consumer surplus after the production quota? d. Calculate the change in the total producer surplus after the production quota, and based on your finding, explain if the producers are better...

  • The following piece of code is intended to find the count of negative numbers in the...

    The following piece of code is intended to find the count of negative numbers in the array. The code compiles correctly but it is giving the wrong answer. There are two logic errors in the code causing the incorrect result Identify the lines of code which are giving the incorrect result, re-write the lines of code with the logic errors corrected and give a brief explanation to why they are giving the incorrect result. i int [] list = {-4,...

  • Your code should contain appropriate validations and must focus on code optimization. Briefly, explain (150-200 words)...

    Your code should contain appropriate validations and must focus on code optimization. Briefly, explain (150-200 words) the logic of the program and how the code can be   optimized. Modify the code to repeat the program until the user enters “no”. (*I need the logical write out on how the program behaves when there is an input from the user. (I don't need the //comments). import java.util.Scanner; public class Q2 {     public static void main(String[] args)     {         Scanner...

  • public class Q7 { public static void main(String[] args) { System.out.println("Math is fun"); //write your logic...

    public class Q7 { public static void main(String[] args) { System.out.println("Math is fun"); //write your logic to continuously get one of the below options and print the result //1.reciprocal (1/x), 2.root (x^1/2), 3.cube (x^3), 4.Quit //get the number x as input from the user each time //hint:- x^n= Math.pow(x,n) } } need help in java

  • For which of the following errors should the appropriate amount be subtracted from the balance per...

    For which of the following errors should the appropriate amount be subtracted from the balance per bank on a bank reconciliation? Check for $63 recorded by the company as $36. A returned $500 check recorded by the bank as $50. Deposit of $500 recorded by the bank as $50. Check for $65 recorded by the company as $56. Please explain why the correct answer is correct, and why incorrect answer choices are wrong. Thank you.

  • The following code computes the radius of a circle. Using static methods from the Math class...

    The following code computes the radius of a circle. Using static methods from the Math class complete the method that computes the radius of a circle using the formula  r2=(x-h)2 +(y-k)2 , given the (x,y) coordinates of one point on its circumference and the (h,k) coordinates of its center. public class Circle {    public static void main(String[] C)    {        double x1 =14.25;        double y1 =13.68;        double xCenter = 25.678;        double yCenter...

  • Logic Exercise 40 Points This exercise tests your ability to understand logic in the form of...

    Logic Exercise 40 Points This exercise tests your ability to understand logic in the form of IF Statements. You will be given the rules and the data that will follow the logic. At the end of the explanation, a series of questions will be asked. Place your answers in the area provided. Program explanation - You are provided with pseudocode that calculates the total amount of money to pay an employee after working for 1 week. The amount of money...

  • For this week, please describe in your own words what multithreading is and how can multiple...

    For this week, please describe in your own words what multithreading is and how can multiple threads run simultaneously on a single-processor system? Provide small code example and the result/output of running your code to demonstrate this behavior. Write a few sentences explaining your code and the result/output of running your code.

  • Can someone fix the program below so it does what the picture says it won't work...

    Can someone fix the program below so it does what the picture says it won't work for me. import java.util.Scanner; public class Userpass { static String arr[]; static int i = 0; public static void main(String[] args) { String username, password; int tries = 0, result; do { System.out.print("Enter the username: "); username = readUserInput(); System.out.print("Enter the password: "); password = readUserInput(); result = verifyCredentials(username, password); tries++; if (result == -1) System.out.println("The username is incorrect!\n"); else if (result == -2)...

  • Results for this submission Answer Preview Result 16 correct 0.01 incorrect 0.025 incorrect At least one...

    Results for this submission Answer Preview Result 16 correct 0.01 incorrect 0.025 incorrect At least one of the answers above is NOT correct. (15 points) Thet statistic for a test of H: = 60 HAN > 60 based on n.17 observations has the value 2.15. (a) What are the degrees of freedom for this statistic? 16 (b) Using the appropriate table in your formula packet, bound the p-value as closely as possible: 0.01 <p-value < 0.025 Results for this submission...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT