One large chemical company pays its salespeople on a commission basis. The salespeople each receive $200 per week plus 9 percent of their gross sales for that week. For example, a salesperson who sells $5000 worth of chemicals in a week receives $200 plus 9 percent of $5000, or a total of $650. Develop a java program inputs each salesperson's gross sales for last week and calculates and displays that salesperson's earnings. Process one salesperson's figures at a time
import java.util.Scanner;
public class SalesCalculation {
public static void main(String[] args) {
// TODO Auto-generated method stub
int i;
System.out.println("Please enter the input count of Sales People");
Scanner sc= new Scanner(System.in);
int a= sc.nextInt();
// for loop start
for(i=0;i<a;i++){
System.out.println("Input"+(i+1)+"-salesperson' gross sales:");
double sum= sc.nextDouble();
System.out.println("Earnings:"+(200 + sum * 0.09));
}
// for loop end
}
}
Comments
Leave a comment