Days & Nights are not the same on vacation


#1

This is more of a sense-check bug report.

In the 'Pulling it together' section, the compiler assumes that the number of days' vacation is the same as the number of nights spent in the hotel. However, if I go away for 5 days, I will only spend 4 nights in the hotel.

The site tells me that I am incorrect when I account for this, i.e., when I use rental_car_cost(days) and hotel_cost(days-1).


#2

True, but many more scenarios in many of the exercise can be made much more complex, but then they wouldn't be do-able. Decision on what to put in the exercise had to be made

You can make this a project of yours, and see where you can improve the code (just to increase your understanding)


#3

I caught the same mistake as well. I think including this kind of detail in the code is important. At the end of the day, a coder ought to be critically thinking about the purpose and meaning of the code they are writing, not just the syntax and structure, and what better way to encourage this than from the start.

In response to stetim94, I see no reason why hotel_costs(days-1) should be deemed too complicated. If anything it's a good reminder for students to think critically as they code. Worst case scenario, they are invited to click on the Hint Button where they can find the answer.