Answer to Question #156850 in Java | JSP | JSF for Jeanma Pataray

Question #156850

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


1
Expert's answer
2021-01-20T07:29:58-0500
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

    }
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog