You can probably set your compiler to not warn you about this. Another way is to change your code and do the cast explicit. roundHours = static_cast<int>(hours + 0.5);
Thank you! Changing the code got rid of the warning, but I'm still having problems with 2.whatever not converting properly...unless there's something else wrong I'm just not seeing.
2.1 hours is not 2 hours and 10 minutes. 2.1 hours is 2 hours and a tenth of an hour. You may run into problems with your addition of 0.5 to get the roundHours. For example if the user input 2.8 hours (which is acceptable as 2 hours 48 minutes) the addition of 0.5 will take it to 3.3 roundHours which will charge for an extra hour (extra $3) when the fee should only be 2 hours @ $7.50 + 1hr @ $3 (the same as the 2.1 mentioned earlier).
Edit: Look into whether integers round to the nearest whole number. I think they always round up, or down.
My professor has not introduced anything pertaining to <cmath> though? Is there any possible way to perform this function using the method I was using, or is the ceil function the only way?
Ps.... I'm very sorry if I'm being frustrating I'm very new to this, thank you so much for any and all help you see fit to provide