Ms. Latte\'s Mopeds \'R Us rents mopeds at Monterey beach boardwalk. To promote
ID: 3621571 • Letter: M
Question
Ms. Latte's Mopeds 'R Us rents mopeds at Monterey beach boardwalk. To promote business during the slow weekdays, the store gives a huge discount. The rental charges are as follows: Write a program that computes the rental charge, given the type of moped, when it is rented (either weekday or weekend), and the number of hours rented.Explanation / Answer
Hope this helps. Let me know if you have any questions. Please rate. :) Assuming this should be done in C++ (only a few basic changes if being done in Java): const int MOPETTE = 0; const int MOHAWK = 1; double calculateWeekendCharge(int type, int hours) { double charge = 0; if (type == MOPETTE) { if (hours >= 3) { charge += 30; hours -= 3; } for (int i = 0; i = 3) { charge += 35; hours -= 3; } for (int i = 0; i = 3) { charge += 15; hours -= 3; } for (int i = 0; i = 3) { charge += 25; hours -= 3; } for (int i = 0; iRelated Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.