It looks like you're new here. If you want to get involved, click one of these buttons!
Look at the following problems and identify
a) the output
b) the input
c) the procedure
3. Dew Drop Inn, has a different rate structure. Here a guest pays by the week (7 nights). The rate is reasonable - $350. per week. But the guest must always pay for an entire week even if he stays less than the full week. Thus, 4 nights would cost 350. as would 7. If a guest stays 8 nights then he must pay for 2 weeks….or 350 times 2. The tax is still 7.5% and the energy charge is 3.50 per night. . Write a program which will allow you to enter a guest's name and the number of nights he stayed at the Inn. Print an itemized bill which shows the cost for the room, the tax, the energy charge and the total tax.
Hint. Since you are entering the number of nights, you will have to convert that to weeks.
HINT: You might be considering "if" for this. (if nights>7 and nights<15, weeks = 2) DON'T DO THIS you would never be able to stop saying "if"….
Think about / which can be used to convert to weeks.
This is the problem I have above.
The trouble iam having is, how do I use the Night--to--Week conversion to find weekly prices, without using (<|> if/Then) statements?
This is confusing me.
For example, if the person stayed in the hotel for 6 days, ---- That would be 6/7 in weeks,
but if I mutiple 6/7 *350, it wont give me the correct weekly price, since that would be less then 350$.
I dont know how to round up numbers using (+ - * / < >) operators.