Search Blog

Biyernes, Enero 18, 2013

One large chemical company pays its salespeople on a commission basis. The salespeople receive $200 per week plus 9% of their gross sales for that week. For example, a salesperson who sells $5000 worth of chemicals in a week receives $200 plus 9% of $5000, or a total of $650. Develop a program that will input each salesperson’s gross sales for last week and will calculate and display that salesperson’s earnings. Process one salesperson’s figures at a time.


Java Codes
--+o0O0o+--

One large chemical company pays its salespeople on a commission basis. The salespeople receive $200 per week plus 9% of their gross sales for that week. For example, a salesperson who sells $5000 worth of chemicals in a week receives $200 plus 9% of $5000, or a total of $650. Develop a program that will input each salesperson’s gross sales for last week and will calculate and display that salesperson’s earnings. Process one salesperson’s figures at a time.


Code:


import java.util.Scanner;

public class MachineProblem9 {

    public static void main(String[] args) {
       
        Scanner input_user = new Scanner(System.in);
       
        float salary_$;
        double recieve_this_week;
       
        System.out.println("******************************************");
        for(int x = 0;x < 1000;x++)
        { 
           
     System.out.print("  Enter sales in dollars (-1 to end): ");
            salary_$ = input_user.nextFloat();
           
            if(salary_$ != -1)
            {
                recieve_this_week = 0.09 * salary_$ + 200;
     System.out.println("  Salary is : $" + recieve_this_week);
                System.out.println("*****************************************");
            }
            else
            {
                return;
            }  
               
            
        }
    }
}

Walang komento:

Mag-post ng isang Komento