Question

JAVA. Write a Java program that accepts the total amount of cars sold and total sales...

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.

Your output must include:

Total Cars Sold (example: 7)

Total $ amount of Cars Sold (example: 70000)

Commission Amount (example: 7,000)

Sales Total Bonus (example: 3,500)

Number of Cars Sold Bonus (example: 0)

Gross Pay (example: 10,500)

Tax Amount (example: 3,500)

Net Pay (example: 7,350)

Must use a loop to run the program until the user enters a ‘X’ to exit.

0 0
Add a comment Improve this question Transcribed image text
Answer #1

If you have any doubts, please give me comment...

import java.util.Scanner;

public class CarSales{

public static void main(String[] args) {

Scanner scnr = new Scanner(System.in);

int noCars;

double totalAmt, commisionAmt, salesBonusAmt, carsSoldBonus, grossPay, taxAmt, netPay;

String temp;

System.out.print("Total Cars Sold: ");

temp = scnr.next();

while(!temp.equalsIgnoreCase("X")){

noCars = Integer.parseInt(temp);

System.out.print("Total $ maount of Cars Sold: ");

totalAmt = scnr.nextDouble();

commisionAmt = totalAmt*(10.0/100);

salesBonusAmt = 0;

if(totalAmt>=50000)

salesBonusAmt = totalAmt*(5.0/100);

carsSoldBonus = 0;

if(noCars>=8)

carsSoldBonus = totalAmt*(3.0/100);

grossPay = commisionAmt + salesBonusAmt + carsSoldBonus;

taxAmt = grossPay *(30.0/100);

netPay = grossPay - taxAmt;

System.out.println("Commision Amount: "+commisionAmt);

System.out.println("Sales Total Bonus: "+salesBonusAmt);

System.out.println("Number of Cars Sold Bonus: "+carsSoldBonus);

System.out.println("Gross Pay: "+grossPay);

System.out.println("Tax Amount: "+taxAmt);

System.out.println("Net Pay: "+netPay);

System.out.print("\n\nTotal Cars Sold: ");

temp = scnr.next();

}

}

}

Add a comment
Know the answer?
Add Answer to:
JAVA. Write a Java program that accepts the total amount of cars sold and total sales...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • 2. Sales Report - PSEUDOCODE 15 PTS + PYTHON 20 PTS Brewster’s Used Cars, Inc. employs...

    2. Sales Report - PSEUDOCODE 15 PTS + PYTHON 20 PTS Brewster’s Used Cars, Inc. employs several salespeople. Brewster, the owner of the company, has provided a file that contains sales records for each salesperson for the past month. Each record in the file contains the following two fields: ● The salesperson’s ID number, as an integer ● The amount of a sale, as a real number Programming Exercises Programming Exercises 427 The records are already sorted by salesperson ID....

  • This Java program must use classes and object-oriented design (OOD) as I'm in a more advanced...

    This Java program must use classes and object-oriented design (OOD) as I'm in a more advanced Java class. (Sales Commission Calculator) A large 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 merchandise in a week receives $200 plus 9% of $5000, or a total of $650. You’ve been supplied with a list of the items sold...

  • Use program control statements in the following exercises: Question 1 . Write pseudocode for the following:...

    Use program control statements in the following exercises: Question 1 . Write pseudocode for the following: • Input a time in seconds. • Convert this time to hours, minutes, and seconds and print the result as shown in the following example: 2 300 seconds converts to 0 hours, 38 minutes, 20 seconds. Question 2. The voting for a company chairperson is recorded by entering the numbers 1 to 5 at the keyboard, depending on which of the five candidates secured...

  • Your instructor would like you to write a program in Java which would ask for the clerk to enter ...

    Your instructor would like you to write a program in Java which would ask for the clerk to enter the total amount of the customer’s order. The program will then calculate a seven percent (7%) sales tax. Commission is computed based on the following: order amount id="mce_marker" - $200 commission is 2%, order amount $201 - $400 commission is 3%, order amount $401 - $600 commission is 4%, order amount > $600 commission is 5%, The program will display the...

  • This is JAVA. Must write a short description of this program, usually a sentence or two...

    This is JAVA. Must write a short description of this program, usually a sentence or two will be sufficient. All the classes, methods and data fields should be clearly documented (commented). Write a program that will ask the user to enter the amount of a purchase. The program should then compute the state and county sales tax. Assume the state sales tax is 4 percent and the county sales tax is 2 percent. The program should display the amount of...

  • Write a C++ program that will calculate the total amount of money for book sales at...

    Write a C++ program that will calculate the total amount of money for book sales at an online store. For each sale, your program should ask the number of books sold and then the price for each book and the shipping method (‘S’ for standard shipping and ‘E’ for expedited shipping). The program will produce a bill showing the subtotal, the sales tax, the discount, the shipping charge, and the final total for the sale. The program will continue processing...

  • Objectives – to practice these new concepts: decision-making with if, if-else, if-else-if-… switch data validation for...

    Objectives – to practice these new concepts: decision-making with if, if-else, if-else-if-… switch data validation for user input using a while (or while/do) loop nicely formatted output report with printf and format strings multiple input data sets using a while (or while/do) loop named constants PROJECT OVERVIEW This project provides a detailed payroll report for the sales staff at TheLaptopShop. The company has 3 tiers of salespeople: low, middle, high (designated by L, M, H) – based on their past...

  • For this lab you will write a Java program that plays the dice game High-Low. In...

    For this lab you will write a Java program that plays the dice game High-Low. In this game a player places a bet on whether the sum of two dice will come up High (totaling 8 or higher), Low (totaling 6 or less) or Sevens (totaling exactly 7). If the player wins, they receive a payout based on the schedule given in the table below: Choice Payout ------ ------ High 1 x Wager Low 1 x Wager Sevens 4 x...

  • Write a Python program that calculate and summarize the sales of every day and finds out...

    Write a Python program that calculate and summarize the sales of every day and finds out who are the best employee who made more profits. For simplicity: We assume that the program works for only two days and for only two employees. i.e. the program collects and summarize the sales of only two days for only two employees The program accepts undefined number of sales for each employee. For example: You could assume in the first day the first employee...

  • Salary Lab In this lab you are going to write a time card processor program. Your...

    Salary Lab In this lab you are going to write a time card processor program. Your program will read in a file called salary.txt. This file will include a department name at the top and then a list of names (string) with a set of hours following them. The file I test with could have a different number of employees and a different number of hours. There can be more than 1 department, and at the end of the file...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT