Question: Java 1 I need to come up with a program with the following specs. Prompt the user to input the total sales. That number will

Java 1 I need to come up with a program with the following specs.

Prompt the user to input the total sales. That number will be input from the keyboard.

Use if and else statements to determine the appropriate commission rate to be used to calculate the commission on the sales amount entered by the user. Commission is paid at the rate of 2% on any amount of $10,000 or less in sales. Anyone selling over $10,000 is paid at the rate of 5% on the total sales amount.

Declare the necessary variables. Note that in the multiplication of the commission rate the result will potentially have a fractional part. Since the commission rates do not change, initialize them as constants.

Use the if and else statements to determine the appropriate rate for the amount of the total sales, then calculate the commission following the if/else structure.

You only need to calculate the commission in one place, rather than having a calculation for each type of commission. Give this aspect of the problem some thought. There are two basic ways you can do this problem as far as the location of the calculation after you have determined the commission rate. Your objective is to do the commission calculation in one place near the end of the program.

Output the total sales amount and the commission amount and use appropriate labels for each (see below).

Use text labels on the output which make it clear what information is being displayed. Do not simply use single words like Commission or Total. Single words such as those are not descriptive enough.

Use: good variable names (should be evident what they hold), indentations of four spaces, comments within the body of the program, and label the output appropriately.

Test your program with numbers above and below the commission limits for accuracy in its calculations. Do not submit programs in which the calculations are not done correctly. Try numbers above, below, and at the commission break points.

Format the output using the printf() function. Also use a $ where appropriate.

All methods will be in the same class for this problem. The new methods will be just below the main method.

Place one blank line between each method.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!