calculating halves (.5)

Hi,

Working on a program where I need to calculate halves...
example: A parent says they will stay for 4.5 hours. If they stayed for 3 hours, they would pay $100. If they stayed for 4.5 hours, they pay $100 plus $75 for the extra half hour as .5hrs = $75
How do I distinguish halves/fractional?

thanks!
Last edited on
division operator / with floats or doubles
Topic archived. No new replies allowed.