Define class method to initialize class data members

Assignment Help Computer Engineering
Reference no: EM1332218

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 . . .

Reference no: EM1332218

Questions Cloud

The supply and demand for air travel : Florida Citrus Mutual, an agricultural cooperative association for citrus growers in Florida, needs to predict what will happen to the price and output of Florida oranges under the conditions below. What are your predictions?
Explain how would you justify the long-term nature : Explain how would you justify the long-term nature of your contract with CGI Group.
Finance-net present value-payback : Project K costs $52,125, its expected net cash inflows is $12,000 per year for eight years, and its WACC is 12%. What's the project's NPV? What's the project's IRR?
Explain web site and confidentiality : Explain Web site and confidentiality, security and international issues and can you please explain how a web site might handle security
Define class method to initialize class data members : compute the salesperson's total commission earned as 10 percent of each sale amount and accumulate a running total commission for each individual.
Explain organization''s compensation strategy : What is the product that your organization makes and sells and What are the major issues that should be considered as part of your organization's compensation strategy
Make an average class with a public data member : make an Average class with a public data member to collect the sum of the integer entries and a public data member to hold the double average of the sum of the 10 integers.
Three key inputs to valuation model : What are three key inputs to the valuation model? How would you find out the valuation of the asset?
Multiple regression with dummy variables : Explain a business situation that would require multiple regression with dummy variables.

Reviews

Write a Review

Computer Engineering Questions & Answers

  What variety of cable will work to make an association

What variety of cable will work to make an association

  Find percentage of the total votes received by candidate

write down a program that allows the user to enter the last names of five candidates in a local election and the votes received by each candidate. The program should then output each candidates name, the votes received by that candidate, and the p..

  What are the types of malicious attack

What are the types of malicious attack

  Too much control is counter-productive define

"Too much control is counter-productive." Do you agree? Provide reasoning of the view.

  How to create a class named integerset

A set is represented internally as an array of Booleans. Array element a[i] is true if integer "i" is in the set. Array element a[j] is false if integer "j" is not in the set. The no-argument constructor initializes a set to the so-called "empty s..

  Write a class called "deck" with the traits

Write a class called "Card" with the following traits: it holds 2 private variables, a suit and a value (ace is high). It has public functions that randomly generate and build the suit, value and print out the suit/value to the screen. Write a suit..

  How each diagram relates to the solution

Your submission should include 6 to 8 pages of Visio developed UML diagrams (minimum of six different ones), hierarchy chart, and flowcharts; copy/paste into a MS Word document that also contains the pseudo code and data dictionary for the solutio..

  Division algorithm

Divide 16 digit value N by the six digit integer D obtaining the quotient Q and remainder (or sign of remainder) R by the following division algorithms. Describe your steps and method in order to obtain the remainder.

  What is a possible downside of making such a choice

The mainframe currently only connects to terminals, but management wants to be able to access it from  desktop. You run a token ring network. The mainframe manufacturer supports Ethernet, but not token ring. maintain an outline of possible solutio..

  Define corrective, adaptive, perfective, and preventive

explain an example of each of the four types of maintenance: corrective, adaptive, perfective, and preventive. Discuss how the decision to proceed is reached in each case. Be specific.

  How to provide a cost-effective means of protection

What will be an appropiate outlined for this and provide a cost-effective means of protection.

  Demorgans theorem

Compute by means of the truth table the validity of DeMorgan’s theorem for three variables: (ABC)’ = A’ + B’ + C’. Simplify the following expressions using Boolean algebra. AB + A(CD + CD’)

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