Parking fee prompt doesnt make much sense

Jun 1, 2016 at 4:31pm
Ive been assigned a program to complete but have been fiddling around with it and just cant get it... To me the prompt doesn't even make much sense. Can anyone help?

"The program will calculate a parking fee at an establishment.
If the car is there less than an hour, it is free.
If theyre there from 1 to 3 hours, it is a flat fee of $5 plus 50 cents per hour there.
If theyre there for 3 hours to 8 hours, it is a flat fee of $7 plus 85 cents an hour.
If there for 8 hours to 16 hours, it is a fee of $2.25 per hour. If there for 16 to 24 hours, it is a flat fee of $10.50 plus $1.75 per hour.
If there for over 24 hours, the car is towed and the fee is $100."
Jun 1, 2016 at 4:57pm
closed account (48bpfSEw)
code incomple:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
double calcFee(int hours) {

  // If the car is there less than an hour, it is free.
  if (hours < 1)
    return 0.0;

  // If theyre there from 1 to 3 hours, it is a flat fee of $5 plus 50 cents per hour there.
  if (hours >= 1 && hours < 3)
    return 5.0 + hours * 0.5;
  
  // If theyre there for 3 hours to 8 hours, it is a flat fee of $7 plus 85 cents an hour.
  if (...)

  // If there for 8 hours to 16 hours, it is a fee of $2.25 per hour. 
  if (...)
  
  // If there for 16 to 24 hours, it is a flat fee of $10.50 plus $1.75 per hour.
  if (...)
  
  
  // If there for over 24 hours, the car is towed and the fee is $100." 
  return 100.0;
  } 
Topic archived. No new replies allowed.