I have a program where a parking garage charges 6 dollars for 3 hours. for extra hours, they charge an extra 2.50. for a 24 hour period they charge 35 dollars. i have my code and it runs but still gets the calculations kind of wrong.
What is the right formula to calculate the extra cost if it goes over 3 hours?
What is the right formula to get the 24 hours to set to 35 dollars?
what is the right formula to calculate if it goes over 25 hours?
How can i set a for loop?
My code:
#include <iostream>
#include <iomanip>
#include <math.h>
using namespace std;
int main ()
{
int hOurs = 0;
float chrGe, exchRge, pchgrGe;
double total, chArge = 6.00, extrachArge = 2.50, periodchA = 35.00;
cout << "Please enter number of hours parked: ";
cin >> hOurs;