Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

************************************************************************************************************************************************************ OUTLINE: // Header // Header // Header import java.util.Scanner; public class comissionShell { public static final double MAX_RATE = 25; /** Main method */

image text in transcribedimage text in transcribedimage text in transcribed

************************************************************************************************************************************************************

OUTLINE:

// Header

// Header

// Header

import java.util.Scanner;

public class comissionShell {

public static final double MAX_RATE = 25;

/** Main method */

public static void main(String[] args) {

Scanner kb = new Scanner(System.in);

run(kb);

}

public static void run(Scanner kb)

{

boolean repeat = true;

while(repeat)

{

// call the method saleAmount

// ask the user if he/she wants to use the app again

// update the loop control variable based on the user's input

}

}

public static void saleAmount(Scanner kb)

{

double salesAmount = 0;

// call the method getValidDouble to get the sale goal amount

// call the method getValidDouble to get the base rate

// call the method getValidDouble to get the percent that the

commisiio increases

// call the method getValidDouble to getthe sale interval that the

commission increases

double commission = 0;

// while (commission is less than the goal)

{

// call the method comission

// if the commission is less thatn the goal

// increase the saleamount by 0.1

}

//output the result

}

public static double comission(double saleAmount, double baseRate,

double increment, double interval)

{

double total = 0;

double com = 0;

double count = 0;

double sale = saleAmount;

//while(sale is greater than interval)

{

// subtract interval from sale and store the result in sale

// add the increment to count

}

// set a variable rate to the base rate

// while rate is less than or equal to base rate + count and

saleAmount is gretaer than interval

{

// set com to interval * rate/100

// reduce the saleAmount by interval

// increase the rate by the increment

// add com to total

}

// if (saleAmount > 0)

//calculate the leftover

return total;

}

//use the code from class to help you with the data type validation and

the range validation

public static double getValidDouble(Scanner kb, String prompt)

{

return 0;

}

}

Problem: Financial application: Finding the sale amount to gain a certain amount of commission. You just have started a sales job in a department store and your pay is based on a commission. Write a program that tells the user the amount of the sale needed to make a certain amount of commission. Your program needs to ask the following questions: 1. The goal for the commission(The amount of the money that you can make) 2. Base rate for the commission. The sale's commission starts at this rate(below table shows 8) 3. The amount that the commission rate increases. (below table shows 2) 4. The amount of the sale needs to increase the commission rate. Table below shows that the commission rate goes up by 2 percent with the interval of 5000 sale amount. The output of your program should be the amount of the sale needed to meet the desired commission. Note: Your output must include the description of your program. This is an example of how the commission could change, in this table the commission rate goes up by 2 percent when the sales amount goes up by 5000. Note that the commission rate cannot be higher than a certain amount which is going to be stored in a constant. You can set the constant to 30 percent. This means that the commission rate will not go over 30 percent. Problem: Financial application: Finding the sale amount to gain a certain amount of commission. You just have started a sales job in a department store and your pay is based on a commission. Write a program that tells the user the amount of the sale needed to make a certain amount of commission. Your program needs to ask the following questions: 1. The goal for the commission(The amount of the money that you can make) 2. Base rate for the commission. The sale's commission starts at this rate(below table shows 8) 3. The amount that the commission rate increases. (below table shows 2) 4. The amount of the sale needs to increase the commission rate. Table below shows that the commission rate goes up by 2 percent with the interval of 5000 sale amount. The output of your program should be the amount of the sale needed to meet the desired commission. Note: Your output must include the description of your program. This is an example of how the commission could change, in this table the commission rate goes up by 2 percent when the sales amount goes up by 5000. Note that the commission rate cannot be higher than a certain amount which is going to be stored in a constant. You can set the constant to 30 percent. This means that the commission rate will not go over 30 percent

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Oracle PL/SQL Programming Database Management Systems

Authors: Steven Feuerstein

1st Edition

978-1565921429

More Books

Students also viewed these Databases questions