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

  Implement avl tree

Implement AVL trees that allows both iterative traversal and recursive traversal.

  Compute the area of the triangle

Compute the area of the triangle using Heron's Formula(below), in which s represents half of the perimeter of the triangle, and a,b, and c, represent the length of the three sides.

  Create and implement class called date to store month

Create and Implement the class called Date which has data members to store month (as a number), day, year, and name of month.

  Write class encapsulating the concept of weather forecast

Write a class encapsulating the concept of the weather forecast, assuming that it has the given attributes: the temperature and the sky conditions, which could be sunny, snowy, cloudy, or rainy.

  Program to maintain list of names with associated numbers

Write a complete subclass of SimpleList named ListSet where the ‘add' method is overridden such that a ListSet will never contain duplicate items - Write a program to maintain a list of names with associated telephone numbers.

  Design a program that does some polynomial operations

Implement polynomial addition by using an add() method, so you could write in program - Build a polynomial (linked list) from a file and the other from keyboard input (pairs of coefficients and powers) by a user.

  Programing of tree java

The listing of Tree.java is supplied below as a starting point for this lab. A picture of Tree.java output is also shown. Either cut/paste the code or type it in. Run the program to verify that it works. Study the listing until you understand comp..

  Create a new child class and new driver program

In this assignment you will create a new child class and new driver program. Please review that example before continuing with this assignment. You should fully understand the shape program above

  Sets a loop to find 10 random generated

Write a java code that 1) uploads a file 2) sets a loop to find 10 random generated words from the file and then search those words by a. IndexSequential Method b. indexBinary Method. then, report how much time both methods took.

  Part-1inheritance write code using eclipse and output

part-1inheritance write code using eclipse and output screenimplement a subclass square that extends the rectangle

  Write java application to demonstrate the behavior

The source code is patterned after a similar example that was taken from Joyce Farrell's textbook, Java Programming.

  List various bindings that are needed to determine semantics

List the various bindings that are required to determine the semantics when the statement is executed. For each binding, indicate the binding time used for the language.

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