Question: The aim of this exercise is to write a program that calculates bicycle rental amounts (for an online 24/24 service). Download the file rental bikes.cpp

The aim of this exercise is to write a program that calculates bicycle rental amounts (for an online 24/24 service). Download the file rental bikes.cpp and complete it according to the below instructions The rental rates are as follows: - From 00:00 to 07:00 and from 17:00 to 24:00:1 dollars. hour: - From 07:00 to 17:00: 2 dollars/hour. The program will ask the user to enter the start and end hours of the rental as integers (part of the furnished code) and will compute and display the rental cost. You will adopt the following simplifications: - the hours are integers (we don't mind about minutes, each started hour will be fully paid) - the start time i.e. hour) of the rental period must always be less than the end time (ie. hour) of the rent. This means that one cannot hire a bicycle more than 24 hours and that cach rental period must lie within the same day. If the inputs are correct, then the program will calculate and show the rental amount on the screen strictly following the format presented in the examples below. If the times entered by the user are not between 0 and 24 (inclusive), then an error message strictly respecting the following format will be shown and the program will terminate: The hours entered must be between 0 and 24! If the start time of the rent is equal to the end time, then an error message strictly respecting the following format will be shown and the program will terminate: Very strange, it seems you don't want to rent a bike! If the end time of the rent is less than the start time, then an error message strictly respecting the following format will be shown and the program will terminate: The end of the rental period cannot be before its start! The provided file already contains some instructions that must be used to produce the requested output. Example of a run of the program: Enter the start of the location (as an integer): 6 Enter the end of the location (as an integer) : 9 You rented the bike for 3 hour(s) The number of hours you rented the bike between 7:00 and 17:00 is: 2 The total amount to pay is 5 dollar(s). Press any key to continue ... Exercise 2- Mushroom identification The purpose of this exercise is to write a C++ program that asks questions to the user in order to guess which mushroom the user has in mind among a list known in advance). In order to guess the user's mushroom, the program can ask at most 3 questions that only have yes no answers (the user will reply to the questions of the program with o forno, and 1 for yes). The 6 possible mushrooms are: - the "yellow agaric": - the "fly agaric": - the porcini mushroom": - the "hairy coprin"; - the "cantharellus cibarius": - the wood blewit". 1- The "porcini mushroom" is the only one to have pores, the other mushrooms having gills. 2. Both "hairy coprin" and "yellow agaric" grow in meadows, while all the other mushrooms grow in the woods. 3. The only mushrooms to have a convex cap are the "yellow agaric", the "fly agaric" and the "wood blewit". 4- And the only mushrooms to have ring are the "yellow agaric", the "fly agaric" and the "porcini mushroom". You are requested to write the whole C++ program so that it can find, using at most 3 questions, the mushroom the user is asking for
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
