Question

In: Computer Science

How to make a flow chart out of this??? To compute the rates you have the...

How to make a flow chart out of this???

To compute the rates you have the following established: 1. Regular service - $6.00 plus first 50 minutes free. Charges for over 50 minutes are $0.20 per minute. 2. Premium service - $15.00 plus: a. For calls made from 6:00am to 6:00pm, the first 75 minutes are free; charges for over 75 minutes are $0.10 per minute. b. For calls made from 6:00pm to 6:00am, the first 100 minutes are free; charges for over 100 minutes are $0.05 per minutes. Task Your task at the moment is to calculate and print out the bill for your customers. Your program should: 1. prompt the user to enter an account number, 2. a service code (type char), a. A service code of r or R means regular service b. A service code of p or P means premium service c. Treat any other character as an error 3. the number of minutes the service was used. Your program should output the account number, type of service, number of minutes the telephone service was used, and the amount due from the user. For the premium service, the customer may be using the service during the day and the night. Therefore, to calculate the bill, you must ask the user to input the number of minutes the service was used during the day and the number of minutes the service was used during the night. Concepts to follow: 1. Assign values to all constant variables that are associated with charges and number of minutes provided in the problem description. 2. The only information the user enters are: account number, type of service, minutes used, and day/night time minutes used based on the plan they have. 3. Remember you are dealing with money therefore should only have 2 decimal places. 4. You must use both a switch statement AND if/else, if/else if’s, or if’s as you see fit. 5. Keep in mind to check for input validation. If validation is incorrect you should have an error message and “kill” your program. 6. Do not use loops

// Cellphone use
#include <iostream>
#include<conio.h>
#include <iomanip>
using namespace std;
int account_number;
float minutes;
char service;
float amount_due;
float day_min;
float night_min;
float regular();
float premium();
int main()
{

cout<< "Please enter your account number: " ;
cin >> account_number;
cout<< "Do you have Regular service or Premium service (r or p)? ";
cin >> service;
// cout<< service <<endl;;
if (service == 'r' || service == 'R')
regular();
else if (service == 'p' || service == 'P')
premium();
else
{
cout<< "Wrong input, program terminated!" << endl;
getch();
return 1;
}
getch();
return 0;

}
float premium()
{

cout<< "How many minutes were used during the day? ";
cin >> day_min;
cout<< "How many minutes were used during the night? ";
cin >>night_min;
if (day_min > 75)
{
amount_due = ((day_min - 75) * .10)+ 15.00;
}
if (night_min > 100)
{
amount_due = ((day_min - 100) * .05)+ 15.00;
}
amount_due = amount_due + 15.00;
cout<< fixed << showpoint << setprecision(2);
cout<< "Amount due: $" << amount_due << endl;
cout<< "Account number: "<< account_number <<endl;
cout<< "Service type: "<< service << endl;
cout<< "Minutes used: "<< (day_min+night_min) <<endl;


return 0;
}
float regular ()
{
cout<< "How many minutes were used? ";
cin >> minutes;
if (minutes <= 50.00)
{
amount_due = 6.00;
cout<< fixed << showpoint << setprecision(2);
cout<< "Amount due: $" << amount_due << endl;
cout<< "Account number: "<< account_number <<endl;
cout<< "Service type: "<< service << endl;
cout<< "Minutes used: "<< minutes <<endl;

}
else
{
amount_due = ((minutes -50.00) * 0.20);
cout<< setw(2) << showpoint << setprecision(3)<< "Amount due: $"<< amount_due << endl;
cout<< "Account number: "<< account_number <<endl;
cout<< "Service type: "<< service << endl;
cout<< "Minutes used: "<< minutes <<endl;
}
getch();
return 0;

}

Solutions

Expert Solution

Please follow this flowchar i have made in Raptor

/*****************output*******************/

Please let me know if you have any doubt or modify the answer, Thanks:)


Related Solutions

create a flow chart on how you would identify citrobacter freundii
create a flow chart on how you would identify citrobacter freundii
Compute the future value of a $160 cash flow for the following combinations of rates and...
Compute the future value of a $160 cash flow for the following combinations of rates and times. (Do not round intermediate calculations. Round your answers to 2 decimal places.) a. r = 8%; t = 10 years b. r = 8%; t = 20 years c. r = 4%; t = 10 years d. r = 4%; t = 20 years
Make a flow chart of the purification scheme for the following scenario. 7. Benzaldehyde is used...
Make a flow chart of the purification scheme for the following scenario. 7. Benzaldehyde is used as the starting material for the synthesis of cinnamic acid. An organic chemistrystudent had made the mistake of stopping the reaction before it was complete and ended up with a mixture ofbenzaldehyde and cinnamic acid. Purify the cinnamic acid. Provide data to show your compound is pure.
The following flow chart is a bubble sort. Write the code for this sort. Make sure...
The following flow chart is a bubble sort. Write the code for this sort. Make sure you display each pass and comparison. Include comments.
6. MAKE A FLOW CHART Follow the influence of light on a single peripheral rod cell...
6. MAKE A FLOW CHART Follow the influence of light on a single peripheral rod cell and explain what happens at the pigment, the cell membrane, the cell terminus, the other retinal cells and the path to the occipital lobe
Make a flow chart for the synthesis of Benzoic Acid from phenyl magnesium bromide and carbon...
Make a flow chart for the synthesis of Benzoic Acid from phenyl magnesium bromide and carbon dioxide. Using your knowledge of the physical properties of the solvents, reactants, and products, show how the products can be purified. Indicate which layer should contain the product in the liquid/liquid extraction steps.
Write out a chart or explain in writing how you would conduct an experiment on retroactive...
Write out a chart or explain in writing how you would conduct an experiment on retroactive interference. Make sure to clearly indicate what is given to both the control and experimental groups. (6 Points)
How to make a PERT Chart on Excel with example project?
How to make a PERT Chart on Excel with example project?
1.Divisors flow chart using modulo operator (%) to print out all the divisors of a user...
1.Divisors flow chart using modulo operator (%) to print out all the divisors of a user entered number. Your program should prompt the user to enter a positive number or 0 to end. Using a loop variable that starts at 1, your program should print out all the divisors of the entered number plus the number of printed divisors and their sum. For example: This program identifies and displays divisors of a given number. Developed as an IPC144 project. Enter...
You have 10 shirts, 9 pants, and 4 belts. How many outfits can you make out...
You have 10 shirts, 9 pants, and 4 belts. How many outfits can you make out of these? (Assume all colors are perfectly coordinated.)
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT