Question

In: Computer Science

Needs to be in JAVA. Write a Java program that accepts the total amount of cars...

Needs to be in JAVA. Write a Java program that accepts the total amount of cars sold and total sales amount of a car salesperson for a given month.

The salesperson’s paycheck is computed as follows:

a. Every sales person gets 10% (commission) of total sales

b. Sales totals greater than $50,000 get 5% of total sales amount

c. 8 or more cars sold earns the salesperson an extra 3%

Please remove 30% (taxes) of the gross pay and list the paycheck amount.

Solutions

Expert Solution

import java.util.Scanner;

public class CarSalesPerson {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int totalCarsSold;
        double totalSales;

        System.out.print("Enter total amount of cars sold: ");
        totalCarsSold = scanner.nextInt();

        System.out.print("Enter total sales amount of a car salesperson for a month: ");
        totalSales = scanner.nextDouble();
        
        double amount = totalSales/10;
        if(totalSales > 50000){
            amount += (totalSales*(5.0/100));
        }
        if(totalCarsSold>=8){
            amount += (totalSales*(3.0/100));
        }
        
        double grossPay = amount*(30.0/100);

        System.out.println("Gross pay = "+grossPay);
        
        amount = amount - grossPay;

        System.out.println("Pay check amount = "+amount);
        
    }
}

Related Solutions

Program in Java code Write a program with total change amount in pennies as an integer...
Program in Java code Write a program with total change amount in pennies as an integer input, and output the change using the fewest coins, one coin type per line. The coin types are Dollars, Quarters, Dimes, Nickels, and Pennies. Use singular and plural coin names as appropriate, like 1 Penny vs. 2 Pennies. .Ex1: If the input is: 0 the output is:    No change            Ex2: If the input is:    45   the output is:   1 Quarter 2 Dimes
For Java 3.25 LAB: Exact change Write a program with total change amount in pennies as...
For Java 3.25 LAB: Exact change Write a program with total change amount in pennies as an integer input, and output the change using the fewest coins, one coin type per line. The coin types are Dollars, Quarters, Dimes, Nickels, and Pennies. Use singular and plural coin names as appropriate, like 1 Penny vs. 2 Pennies. Ex: If the input is: 0 the output is: No change Ex: If the input is: 45 the output is: 1 Quarter 2 Dimes...
java Problem 3: An Interesting Problem Write a program that accepts two positive integers: a deposited...
java Problem 3: An Interesting Problem Write a program that accepts two positive integers: a deposited amount of money and an interest rate, as an annual percentage rate. Your program will calculate the number of years that will take for the account balance to reach $1, 000,000. You can assume that the initial deposit is less than $1,000,000 Input The input will begin with a single line containing T , the number of test cases to follow. The remaining lines...
Needs to be in basic JAVA Write a program that does basic encrypting of text. You...
Needs to be in basic JAVA Write a program that does basic encrypting of text. You will ask the user the filename of a text file that contains a few sentences of text. You will read this text file one character at a time, and change each letter to another one and write out to an output file. The conversion should be done a -> b, b->c , … z->a, A->B, B->C, …. Z->A. This means just shift each letter...
Your task is to write a program in C or C++ that calculates the total amount...
Your task is to write a program in C or C++ that calculates the total amount of money a person has made over the last year. Your program will prompt the user for dollar amounts showing how much the user has made per job. Some users will have had more than one job, make sure your program allows for this. The program will print out the total made (all jobs) and will print out the federal and state taxes based...
In the space provided below write a C ++ program that computes the total amount of...
In the space provided below write a C ++ program that computes the total amount of money you are depositing in your bank account. Your program does this by asking you to first enter the number and amount of each check you are depositing, and then it asks you to enter the type of cash bills being deposited and how many of each type, also the types of coins being deposited, and the number of each coin type.
Write a program in pyton with total change amount as an integer input, and output the...
Write a program in pyton with total change amount as an integer input, and output the change using the fewest coins, one coin type per line. The coin types are Dollars, Quarters, Dimes, Nickels, and Pennies. Use singular and plural coin names as appropriate, like 1 Penny vs. 2 Pennies. Ex: If the input is: 0 (or less than 0), the output is: No change Ex: If the input is: 45 the output is: 1 Quarter 2 Dimes Can you...
Write in C++ Write a program that accepts the names of three political parties and the...
Write in C++ Write a program that accepts the names of three political parties and the number of votes each received in the last mayoral election. Display the percentage of the vote each party received.   Be sure to provide labels (party name) and number-align your output values.
3. Write a java method that accepts a binary number and converts it to decimal then...
3. Write a java method that accepts a binary number and converts it to decimal then display the result. For Example: (110)2 = (6)10 (2 2 *1)+ (21 *1) + (20*0) = 6 Additional task: write a method that accepts a decimal and converts it to binary. i need to solve it as soon as and i will upvote you directly
In Java, write a recursive function that accepts a string as its argument and prints the...
In Java, write a recursive function that accepts a string as its argument and prints the string in reverse order. Demonstrate the function in a driver program.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT