Question

In: Computer Science

n this exercise, you create a program for the sales manager at Computer Haven, a small...

n this exercise, you create a program for the sales manager at Computer Haven, a small business that offers motivational seminars to local companies. Figure 7-53 shows the charge for attending a seminar. Notice that the charge per person depends on the number of people the company registers. For example, the cost for four registrants is $400; the cost for two registrants is $300. The program should allow the sales manager to enter the number of registrants for as many companies as needed. When the sales manager has finished entering the data, the program should calculate and display the total number of people registered, the total charge for those registrants, and the average charge per registrant. For example, if one company registers four people and another company registers two people, the total number of people registered is six, the total charge is $700, and the average charge per registrant is $116.67. Number of people a company registers . Charge per person ($)

1 – 3 150

4 – 9 100   

10 or more 90

fig 7-53   

a.Create an IPO chart for the problem, and then desk-check the algorithm appropriately.b.List the input, processing, and output items, as well as the algorithm, in a chart similar to the one shown earlier in Figure 7-42. Then code the algorithm into a program.c.Desk-check the program using the same data used to desk-check the algorithm.d.If necessary, create a new project named Advanced25 Project, and save it in the Cpp8\Chap07 folder. Enter your C++ instructions into a source file named Advanced25.cpp. Also enter appropriate comments and any additional instructions required by the compiler. Display the average charge with two decimal places

Solutions

Expert Solution

Below is the code for given problem with proper commenting, just copy and run the program :

#include <iostream>

using namespace std;

class SalesManager{
  
private:
int num_of_attendees;

public:
//mutators to set the value
void setNumberofAttendies(int num_of_attendees)
{
this->num_of_attendees = num_of_attendees;
}

//accessors to get the value
int getNumberofAtendees()
{
return num_of_attendees;
}
};


//main function, from where execution start
int main()
{
  
int num_of_companies;
int attendees;
int total_attendees = 0;
cout<<"Welcome to the computer Heaven\n";
cout<<"Total no of companies : ";
cin >> num_of_companies;
  
//no of object is equal to no of companies
SalesManager sm[num_of_companies];
  
for(int i=1; i<=num_of_companies; i++)
{
cout<<"For Company "<<i<<" ---> ";
cout<<"Total num of attendees : ";
cin >> attendees;
if(attendees < 0)
{
cout<<"People count can not be negative";
i--;
}
else
{
//setting the number of attendies
sm[i-1].setNumberofAttendies(attendees);
  
//getting the number of attendees value
total_attendees += sm[i-1].getNumberofAtendees();
}
}
  
  
  
int total_charge;
int average_charge;
cout<<"Total Attendees : "<<total_attendees<<"\n";
  
//If-Else statements to calculate total charge
if(total_attendees>0 && total_attendees<=3)
{
total_charge = total_charge * 150;
}
else if( total_attendees>3 && total_attendees<=9)
{
total_charge = total_attendees * 100;
}
else
{
total_charge = total_attendees * 90;
}

cout<<"Total Charge : "<<total_charge<<"\n";
average_charge = total_charge/total_attendees;
cout<<"Average Charge : "<<average_charge;
return 0;
}


-----------------------------------------------------------------------------------------------------------------------------------------------------------------

Output :

------------------------------------------------------------------------------------------------------------------------------------------------------------------

IPO Chart :


Related Solutions

In this exercise, you create a program for the sales manager at Computer Haven, a small...
In this exercise, you create a program for the sales manager at Computer Haven, a small business that offers motivational seminars to local companies. Figure 7-53 shows the charge for attending a seminar. Notice that the charge per person depends on the number of people the company registers. For example, the cost for four registrants is $400; the cost for two registrants is $300. The program should allow the sales manager to enter the number of registrants for as many...
The manager of Fish Haven wants a program that displays the number of gallons of water...
The manager of Fish Haven wants a program that displays the number of gallons of water a rectangular aquarium holds, given the aquarium’s length, width, and height measurements in inches. (Hint: There are 231 cubic inches in a gallon.)a.Using the chart shown earlier in Figure 4-12 as a guide, enter the input, processing, and output items, as well as the algorithm, in the first column. b.Desk-check the algorithm twice. For the first desk-check, use 20.5, 10.5, and 12.5 as the...
You are an IT manager for a small business. You are being asked to create a...
You are an IT manager for a small business. You are being asked to create a network security plan both for internal IT workers and for the company in general. You are to put together a network security plan that addresses each of the following components : Explain the use of virtual private networks (VPNs) and their security benefits and drawbacks. Create a standard procedure for adding new users to a network. Create a summary of a network plan, including...
Case 1 John is the manager of a small computer sales and support chain. He has...
Case 1 John is the manager of a small computer sales and support chain. He has stores located throughout the state of California and is in strong competition with all of the major computer providers within that state. John’s company is known for providing quick support and friendly service. In the process of selling goods to customers, John’s company will often offer deals that include free service or low-priced service for the products being purchased. John’s competitors offer the same...
Case 1 John is the manager of a small computer sales and support chain. He has...
Case 1 John is the manager of a small computer sales and support chain. He has stores located throughout the state of California and is in strong competition with all of the major computer providers within that state. John’s company is known for providing quick support and friendly service. In the process of selling goods to customers, John’s company will often offer deals that include free service or low-priced service for the products being purchased. John’s competitors offer the same...
In this exercise, you will create a program that displays the amount of a cable bill....
In this exercise, you will create a program that displays the amount of a cable bill. The amount is based on the type of customer, as shown in Figure 10-30. For a residential cus- tomer, the user will need to enter the number of premium channels only. For a business customer, the user will need to enter the number of connections and the number of premium channels. Use a separate void function for each customer type. If necessary, create a...
In this exercise, you will create a program that displays the amount of a cable bill....
In this exercise, you will create a program that displays the amount of a cable bill. The amount is based on the type of customer shown in figure 10-30. For a residential customer, the user will need to enter the number of premium channels only. For a business customer, the user will need to enter the number of connections and the number of premium channels. Use a separate void function for each customer type. Enter your C++ instructions into the...
You are required to create a sales and marketing management system with a small number of...
You are required to create a sales and marketing management system with a small number of common sense attributes. The system should contain the following information Sales details Marketing details Customer details Production details Delivery details Management details So consider what sales and marketing system is required to deliver a consistent and customer oriented service to all customers over the world. You need to identify the tables you require and the information that they are to contain. This is only...
You are required to create a sales and marketing management system with a small number of...
You are required to create a sales and marketing management system with a small number of common sense attributes. The system should contain the following information  Sales details  Marketing details  Customer details  Production details  Delivery details  Management details So consider what sales and marketing system is required to deliver a consistent and customer oriented service to all customers over the world. You need to identify the tables you require and the information that they...
Suppose you are the manager of a small, local diner. You have been studying the sales...
Suppose you are the manager of a small, local diner. You have been studying the sales data of your restaurant over the past year. You have managed to identify two groups of            consumers who frequent your establishment and have cross-referenced their orders with historical data. You have jotted down the following notes to yourself:                         Hamburger French Fries Group 1 Maximum Valuation $3.00 $1.00 Group 2 Maximum Valuation $2.50 $2.00 Currently, you sell your products a la carte (separately...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT