In: Computer Science
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 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
Figure 7-53
a. Create an IPO chart for the problem, and then desk-check the
algorithm appropriately. and . 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.
please provide ipo chart and algorithm. thank you C++
PLEASE GIVE IT A THUMBS UP, I SERIOUSLY NEED ONE, IF YOU NEED ANY MODIFICATION THEN LET ME KNOW, I WILL DO IT FOR YOU
#include <iostream>
#include <iomanip>
using namespace std;
//Main function
int main()
{
//Variables
int numR, totR = 0;
double amt, totA = 0;
double avgAmt;
//Loop till user want to quit
while (1)
{
//Reading number of registrations
cout << "\n\n Number of people for registration(-999 to stop): ";
cin >> numR;
//For two decimal places
cout << fixed << setprecision(2);
//Validating number of registrations
if (numR != -999)
{
//Checking amount
if (numR >= 1 && numR <= 3)
{
//Calculating amount
amt = numR * 150;
}
else if (numR >= 4 && numR <= 9)
{
//Calculating amount
amt = numR * 100;
}
else if (numR >= 10)
{
//Calculating amount
amt = numR * 90;
}
else
{
amt = 0;
}
//Adding to total amount
totA += amt;
//Adding to total number of registration
totR += numR;
cout << "\n Registration amount for " << numR << " registrations: $" << amt;
}
else
{
break;
}
}
//Calculating average
avgAmt = totA / (double)(totR);
//Printing results
cout << endl
<< " Total number of people registered: " << totR << endl;
cout << endl
<< " Total charge: $" << totA << endl;
cout << endl
<< " Average charge: $" << avgAmt << endl;
return 0;
}