Question
Questions for the programming experts: How would you guys handle flowcharts with specific coding (see below) or would the flowchart be based on the individual
Specific code mentioned:
#include
using namespace std;
double getHours();
char menu();
double calculateBill(double hours, char packageChoice);
void printMonthlyBill(double bill);
int main()
{
int packageChoice=menu();
double hours=getHours();
double bill=calculateBill(hours, packageChoice);
printMonthlyBill(bill);
system("pause");
}
double getHours()
{
double hours;
cout"please>
cin>>hours;
return hours;
}
char menu ()
{
char packageChoice;
cout"[1]>
cout"[2]>
cout"[3]>
cout"please>
cin>>packageChoice;
return packageChoice;
}
double calculateBill(double hours, char packageChoice)
{
switch (packageChoice)
{
case 'a':
case 'A':
if (hours
{
return 9.95;
}
else
{
return (hours - 10)*2 + 9.95;
}
case 'b':
case 'B':
if (hours
{
return 13.95;
}
else
{
return (hours - 20) + 13.95;
}
case 'c':
case 'C':
return 19.95;
default:
cout"invalid>
return 0;
}
}
void printMonthlyBill(double bill)
{
cout"monthy>
}
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started