Can anyone help me out?
An Internet service provider has three different subscription packages for its customers:
Package A: For $15 per month with 50 hours of access provided.
Additional hours are $2.00 per hour over 50 hours.
Assume usage is recorded in one-hour increments,
Package B: For $20 per month with 100 hours of access provided.
Additional hours are $1.50 per hour over 100 hours.
Package C: For $25 per month with 150 hours access is provided.
Additional hours are $1.00 per hour over 150 hours
Write a program that calculates a customer’s monthly charges.
Implement with the following functions for your solution.
getPackage
validPackage
getHours
validHours
calculatePkg_A
calculatePkg_B
calculatePkg_C
calculateCharges
showBill
What i got so far is this but idk how to make it work in the main
char getPackage(); // function returns a char
char getHours(); // function returns a char
void showBill( double chg ); // function requires a double argument
int main()
{
getPackage(); // the return value of function is not stored/used
getHours(); // the return value of function is not stored/used
void showBill(); // this is not a function call.
// It declares a function that takes no arguments and returns nothing
// showBill() and showBill(double) are different functions
return 0;
}
You can clearly call functions with arguments and use their return values.
(Calls to validHours and validPackage.) Calling functions from main() is no different.