double calculateCharges(double hoursParked)
double charges=2;
if(hoursParked>3)
{
charges=charges+(hoursParked*.5)//might want .5 as a variable
}
if(hoursParked>19)
//16*.5=8, 8+2 is 10, if over 19, want to set charge to maximum, not more
{
charges=10;
}
return charges;
that help?
double charges=2;
if(hoursParked>3)
{
charges=charges+(hoursParked*.5)//might want .5 as a variable
}
if(hoursParked>19)
//16*.5=8, 8+2 is 10, if over 19, want to set charge to maximum, not more
{
charges=10;
}
return charges;
that help?