Programming Project 10.13.3: •••. Implement a base class Appointment and derived classes Onetime, Daily, Weekly, and Monthly. An appointment has a description (for example, “see the dentist”) and a date and time. Write a virtual function occurs_on(int year, int month, int day) that checks whether the appointment occurs on that date. For example, for a monthly appointment, you must check whether the day of the month matches. Then fill a vector of Appointment* with a mixture of appointments. Have the user enter a date and print out all appointments that happen on that date.

Question
in progress 0 7 months 1 Answer Reply 18 views

Programming Project 10.13.2: ••. Add an alarm feature to the Clock class of Programming Project 10.13.1. When set_alarm(hours, minutes) is called, the clock stores the alarm. When you call get_time, and the alarm time has been reached or exceeded, return the time followed by the string “Alarm” (or, if you prefer, the string “\u23F0”) and clear the alarm. What do you need to do to make the set_alarm function work for WorldClock objects?

Question
0 7 months 0 Answers Reply 14 views

Programming Project 10.13.1: ••. Implement a class Clock whose get_hours and get_minutes member functions return the current time at your location. To get the current time, use the following code, which requires that you include the header: time_t current_time = time(0); tm* local_time = localtime(&current_time); int hours = local_time->tm_hour; int minutes = local_time->tm_min; Also provide a get_time member function that returns a string with the hours and minutes by calling the get_hours and get_minutes functions. Provide a derived class WorldClock whose constructor accepts a time offset. For example, if you live in California, a new WorldClock(3) should show the time in New York, three time zones ahead. Which member functions did you override? (You should not override get_time.)

Question
in progress 0 7 months 1 Answer Reply 9 views

Programming Project 9.22.9: •••. After closing time, the store manager would like to know how much business was transacted during the day. Modify the CashRegister class to enable this functionality. Supply member functions get_sales_total and get_sales_count to get the total amount of all sales and the number of sales. Supply a member function reset_sales that resets any counters and totals so that the next day’s sales start from zero.

Question
in progress 0 7 months 1 Answer Reply 13 views

Programming Project 9.22.5: •. Write a class Battery that models a rechargeable battery. A battery has a constructor Battery(double capacity) where capacity is a value measured in milliampere hours. A typical AA battery has a capacity of 2000 to 3000 mAh. The member function void drain(double amount) drains the capacity of the battery by the given amount. The member function void charge() charges the battery to its original capacity. The member function double get_remaining_capacity() gets the remaining capacity of the battery.

Question
in progress 0 7 months 1 Answer Reply 13 views