Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Programming Language Expert

Three salespeople work at Sunshine Hot Tubs. They are Andrea, Brittany, and Eric. You will write a program that will prompt the user for a salesperson's initial ('A' for Andrea, 'B' for Brittany and 'E' for Eric), will take an entry for the salesperson's amount of sales and will collect a total of commissions for each individual salesperson. If a letter other than A/a, B/b or E/e is entered give the user an advisory that the entry is not recognized so they can enter again. Calculate the salesperson's total commission earned as 10 percent of each sale amount and accumulate a running total commission for each individual.

The program will loop to take inputs for any combination of the salespeople until a 'z' or 'Z' is entered at the prompt for the initials. If the user types a 'z' or 'Z' the input process will end and the results will be printed to the console for each salesperson.

These are the code construct requirements for the program that must be met:

1. Create a project called Assignment2_yourlastname and separate from that wrapper class create a class named Sales.

2. Sales class data members for a char letter input from the console, a double to hold each individual sale as it is entered and a double for each of the individual salesperson's total commission.

3. Sales class will have a constant (const) double COMMRATE data member that will be set to 0.10.

4. A class method to initialize class data members.

5. A class method implementing a sentinel loop that will take the inputs for initial and sales amount until the sentinel 'z' or 'Z' is entered and will then calculate a running total of commission for the individual sales person entered.

6. A class method to print the total sales commissions for each salesperson.

7. In Main you will instantiate one Sales object and will call each of the class methods in turn.

8. Internal documentation

The following is basic outline of the requirements:

class Sales
{
char //input character
double //four class data members

const double COMMRATE = 0.10;

public void initialize()
{
}

public void computeSales()
{
}

public void printSales()
{
}
}

class assignment2_yourlastname
{
public static void Main()
{
//instantiate a Sales object

//call each of the class methods in turn
}
}

The following is example output:

Enter a salesperson initial B

Enter amount of sale 2222.22

Enter next salesperson or Z to quit a

Enter amount of sale 1111.11

Enter next salesperson or Z to quit e

Enter amount of sale 3333.33

Enter next salesperson or Z to quit b

Enter amount of sale 2222.22

Enter next salesperson or Z to quit a

Enter amount of sale 1111.11

Enter next salesperson or Z to quit z

Andrea earned $222.22

Brittany earned $444.44

Eric earned $333.33

Press any key to continue . . .

Programming Language, Programming

  • Category:- Programming Language
  • Reference No.:- M91606923
  • Price:- $20

Priced at Now at $20, Verified Solution

Have any Question?


Related Questions in Programming Language

Extend the adworks applicationi add dialogs to allow the

Extend the AdWorks application I. Add Dialogs to allow the user to Add, Edit, Read and Delete a Customer and refresh the view accordingly. 1. The user should be able to select a specific customer from the DataGrid and cl ...

Php amp session managment assignment -this assignment looks

PHP & SESSION MANAGMENT ASSIGNMENT - This assignment looks at using PHP for creating cookies and session management. Class Exercise - Web Project: Member Registration/Login This exercise will cover adding data connectivi ...

Assignment - horse race meetingthe assignment will assess

Assignment - Horse Race Meeting The Assignment will assess competencies for ICTPRG524 Develop high level object-oriented class specifications. Summary The assignment is to design the classes that are necessary for the ad ...

Question - create a microsoft word macro using vba visual

Question - Create a Microsoft Word macro using VBA (Visual Basic for Applications). Name the macro "highlight." The macro should highlight every third line of text in a document. (Imagine creating highlighting that will ...

Task - hand execution of arraysoverviewin this task you

Task - Hand Execution of Arrays Overview In this task you will demonstrate how arrays work by hand executing a number of small code snippets. Instructions Watch the Hand Execution with Arrays video, this shows how to ste ...

Assignmentquestion onegiving the following code snippet

Assignment Question One Giving the following code snippet. What kind of errors you will get and how can you correct it. A. public class HelloJava { public static void main(String args[]) { int x=10; int y=2; System.out.p ...

Assignment - horse race meetingthe assignment will assess

Assignment - Horse Race Meeting The Assignment will assess competencies for ICTPRG524 Develop high level object-oriented class specifications. Summary The assignment is to design the classes that are necessary for the ad ...

Assignment task -q1 a the fibonacci numbers are the numbers

Assignment Task - Q1. (a) The Fibonacci numbers are the numbers in the following integer sequence, called the Fibonacci sequence, and are characterised by the fact that every number after the first two is the sum of the ...

Structs and enumsoverviewin this task you will create a

Structs and Enums Overview In this task you will create a knight database to help Camelot keep track of all of their knights. Instructions Lets get started. 1. What the topic 5 videos, these will guide you through buildi ...

Assignment - haskell program for regular expression

Assignment - Haskell Program for Regular Expression Matching Your assignment is to modify the slowgrep.hs Haskell program presented in class and the online notes, according to the instructions below. You may carry out th ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As