*/ import java.util.Scanner; public class Salescomission { Scanner input = new S
ID: 3627082 • Letter: #
Question
*/import java.util.Scanner;
public class Salescomission {
Scanner input = new Scanner (System.in);
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
Scanner input = new Scanner (System.in);
int array99 =0;
double Sales = input.nextDouble();
double Commission = .09;
double Pay = 200.00;
System.out.printf("Sales Amount, -1 to end: ");
while (Sales != -1)
Sales = Commission * Sales + Pay;
System.out.printf("Total Pay Is:" + Sales);
if Sales >= 200 and Sales <= 399 Then array9(0)array9(0) + 1
{
else if Sales >= 400 and Sales <= 599 Then array9(1)array9(1) + 1
else if Sales >= 600 and Sales <= 799 Then array9(2)array9(2) + 1
else if Sales >= 800 and Sales <= 999 Then array9(3)array9(3) + 1
else if Sales >= 1000 Then array9(4)array9(4) + 1
}
Explanation / Answer
please rate - thanks
I get the feeling you know BASIC
didn't know exactly what you were tring to do, so did it the best I could
import java.util.Scanner;
public class Salescomission {
Scanner input = new Scanner (System.in);
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
Scanner input = new Scanner (System.in);
int array9[] ={0,0,0,0,0};
double Sales = input.nextDouble();
double Commission = .09;
double Pay = 200.00;
System.out.printf("Sales Amount, -1 to end: ");
while (Sales != -1)
Sales = Commission * Sales + Pay;
System.out.printf("Total Pay Is:" + Sales);
if (Sales >= 200 && Sales <= 399 )
array9[0]=array9[0] + 1;
else if( Sales >= 400 && Sales <= 599 )
array9[1]=array9[1] + 1;
else if (Sales >= 600 && Sales <= 799)
array9[2]=array9[2] + 1;
else if (Sales >= 800 && Sales <= 999)
array9[3]=array9[3] + 1;
else
array9[4]=array9[4] + 1;
}
}
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.