A class method to initialize class data members.

Assignment Help Programming Languages
Reference no: EM13936039

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: EM13936039

Questions Cloud

Find total revenue and marginal revenue in both situation : The radio advertisement costs $600 a month (30 days), find the firm's profit per case of energy drink (hint: consider daily advertisement cost)
Online education proving to be successful : Is online education proving to be successful? Your task is to provide a critical review of the current market for online education as well as providing an overview and definition of what online education is and how it works.
Evaluate the organisational and national cultural issues : Identify and evaluate the organisational and national cultural issues that you may have to deal with on assuming responsibility for the new manufacturing facility.
Develop and defend a business continuity proposal : Task goals · Develop and defend a business continuity proposal based on sound research for the information technology needs of an organization.
A class method to initialize class data members. : 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.
How might reports empower an organization : Describe the difference between internal and external reports. What functions might an organization's internal reports serve? What functions might its external reports serve? How might reports empower an organization
Provide your assessment as to firms degree of transaction : Provide your assessment as to your firm's degree of transaction exposure (as to whether the exposure is high or low). Explain your answer.
Working as an it consultant for abc colleg : You are working as an IT consultant for ABC College. This college was established on year 2000. ABC College has got 500 users and runs different courses such as, Diploma of accounting, Cert IV of accounting, Advance Diploma of IT (Networking), Dip..
What is the government revenue from the tariff : What is the gain or loss to U.S. tennis racquets buyers from the tariff? What is the gain or loss to U.S. tennis producers from the tariff? What is the government revenue from the tariff?

Reviews

Write a Review

Programming Languages Questions & Answers

  Design a program written psuedocode enter total rainfall

Design a program WRITTEN IN PSUEDO CODE that lets the user enter the total rainfall for each of 12 months into an array.

  Write program that compute the amount person earn

Write a program which computes the amount a person would earn over period of time if his or her salary is one penny the first day, two pennies second day.

  Programming language for a new point-of-sale system

You are the lead programmer for a new software project and have been assigned to choose the programming language for a new point-of-sale system

  Threads belonging to same process affected by page fault

Other user user threads belonging to the same process also be affected by the page fault - that is would they also have to wait for the faulting page to be brought into memory? Explain.

  Find the maximum and minimum of a list of numbers

Write a prolog program to find the maximum and minimum of a list of numbers.

  Develop a simple program for inventory system

You have to develop a simple program for an inventory system. You can choose any type of business (ie: Medical supplies, bakery, grocery shop, florist etc.)

  Different class maintain programming programs are organized

It allows different classes to maintain programming so that programs are kept more organized. Object orientation also allows a programmer to use the same objects in different programs. Response?

  Create a class called pizzaorder

Create a class called PizzaOrder that has the following members: toppingsOffered[] - a constant array of Strings representing the choice of low-price toppings, e.g., { "onions", "bell peppers", "olives", "pepperoni"... }. This member is public and..

  Data members to store values of the two loans

A class that represents a person who belongs to a SACCO has two data members to store values of the two loans the person owes the SACCO. Add a parameterized constructor that initializes these loans using the two values passed as arguments.

  Write pseudocode for worm moving toward apple

Worm is moving toward an apple. Each time it moves, worm cuts distance between itself and apple by its own body length until worm is close enough to enter the apple. Give pseudocode for this.

  Create a program that reads in numbers from a file

Create a program that reads in numbers from a file and determines if they are in between two other numbers. For example, it might print a message if the number is between 1 and 5.

  Accepts two int arguments and returns their sum

Assume the availability of a class named Arithmetic that provides a static method , add , that accepts two int arguments and returns their sum .

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