Calculate the total commission received by a salesperson

Assignment Help JAVA Programming
Reference no: EM13809335

The following program attempts to calculate the total commission received by a salesperson who earns 7% on sales of product A which total less than $40,000 and 10% on the amount of sales above $40,000. For example, a sale of $50,000 would earn a commission of $3800. The salesperson receives a commission of 5% on sales of product B under $20,000, 6.5% on the amount of sales over $20,000 but under $50,000, and 7.5% on the amount over $50,000. Find and correct any errors in this program:

public class Commission {

public static void main(String [] args) {

Console.Write("Enter the amount of Product A sales: ");

double salesOfA = double.Parse(Console.ReadLine());

Console.Write("Enter the amount of Product B sales: ");

double salesOfB = double.Parse(Console.ReadLine());

double amount = 0;

if (salesOfA < 40000.00)

amount += .07 * salesOfA;

else

amount = .1 * (salesOfA - 40000.0);

if (salesOfB 20000.00 || salesOfB < 50000.00)

amount += 1000 + .065 * (salesOfB - 50000.00);

else

amount = .075 * (salesOfB - 50000.00);

Console.WriteLine("The commission is {0}",amount);

}

}

Reference no: EM13809335

Questions Cloud

Structure of the industry : Analysis of the industry in which the firm is operating. The industry analysis should include the structure of the industry in which the company is operating, trends, outlook, and concentration. The use of a strategic group map could be helpful in..
Write summary explaining principle you use to writing letter : Write a summary explaining the principles you used when writing your letter. Your explanation should make use of the Background Info, properly cited and referenced.
Discuss some of the criticisms of fema over the years : Discuss some of the criticisms of FEMA over the years. Who is the current director of FEMA. Is this person qualified for the position
Understanding contextual theory : Understanding Contextual Theory
Calculate the total commission received by a salesperson : The following program attempts to calculate the total commission received by a salesperson who earns 7% on sales of product A which total less than $40,000 and 10% on the amount of sales above $40,000
Developments in the global environment of business : What will be the key developments in the global environment of business during the next five years? On the basis of these, what will be the greatest challenges that firms from the advanced industrialized countries will face?
Comfy shoes inc builds shoes tailored to meet each individu : Comfy Shoes Inc. builds shoes tailored to meet each individual customer's needs.  Customers who visit the downtown offices of Comfy Shoes in Philadelphia can choose one or more of the following four custom-tailoring services.  Customers receive their..
Write a computer program that prompts the user for a number : Write a computer program that prompts the user for a number, creates an array for that number of random integers, and then uses the sophisticated form of bubble sort to order the array
Demonstrate an understanding of information literacy : Demonstrate an understanding of information literacy and the ability to locate, retrieve, evaluate, analyze, and use information.

Reviews

Write a Review

JAVA Programming Questions & Answers

  Recursive factorial program

Write a class Array that encapsulates an array and provides bounds-checked access. Create a recursive factorial program that prompts the user for an integer N and writes out a series of equations representing the calculation of N!.

  Hunt the wumpus game

Reprot on Hunt the Wumpus Game has Source Code listing, screen captures and UML design here and also, may include Javadoc source here.

  Create a gui interface

Create GUI Interface in java programing with these function: Sort by last name and print all employees info, Sort by job title and print all employees info, Sort by weekly salary and print all employees info, search by job title and print that emp..

  Plot pois on a graph

Write a JAVA program that would get the locations of all the POIs from the file and plot them on a map.

  Write a university grading system in java

University grading system maintains number of tables to store, retrieve and manipulate student marks. Write a JAVA program that would simulate a number of cars.

  Wolves and sheep: design a game

This project is designed a game in java. you choose whether you'd like to write a wolf or a sheep agent. Then, you are assigned to either a "sheep" or a "wolf" team.

  Build a graphical user interface for displaying the image

Build a graphical user interface for displaying the image groups (= cluster) in JMJRST. Design and implement using a Swing interface.

  Determine the day of the week for new year''s day

This assignment contains a java project. Project evaluates the day of the week for New Year's Day.

  Write a java windowed application

Write a Java windowed application to do online quiz on general knowledge and the application also displays the quiz result.

  Input pairs of natural numbers

Java program to input pairs of natural numbers.

  Create classes implement java interface

Interface that contains a generic type. Create two classes that implement this interface.

  Java class, array, link list , generic class

These 14 questions covers java class, Array, link list , generic class.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd