Grrl in limbo c++ using if, if else and switchs.
Code:
//Design a C++ program that asks the user to enter the number of pages to be faxed?
//The algorithm then uses the number of pages to be faxed to the calculate the amount //due.
#include <iostream>
using namespace std;
int main()
{
double billingAmount;
double numOfPages;
cout << "Enter number of pages to faxed: ";
cin >> numOfPages;
if (numOfPages <= 10)
cout << "Billing Amount for less than 10 pages: " << endl;
cin >> billingAmount >>
cout << "Bill Amount: " << endl;
else (numOfPages > 10)
cout << "bill amount for more than 10 pages: " << billingAmount << "Bill Amount: " << endl;
billingAmount = 3.00 + (numOfPages * 0.20);
billingAmount = 3.00 + 10 * 0.20+(numOfPages - 10) * 0.10;
return 0;
}
This is what I have and its probably wrong. This is the information I'm trying to go by.
numOfPages = # of pages to be faxed
billingAmount = total charges for the pages faxed.
numOfPages is less than or equal to 10 the billing amount
is serivce charges + (numOfPages x 0.20); otherwise,
billing amount is service charges + 10 X 0.20 +
(numOfPages - 10) x .10.
Get numOfPages
calculate billing amount using the formula:
if (numOfPages is less than or equal to 10)
billingAmount = 3.00 + (numOfPages X 0.20);
else if
billingAmount-3.00+10x0.20+(numOfPage… = 10) x 0.10;