Question: Question 1 (10 points) Consider the following problem. A babysitter is logging all the earnings they get for children they care for. You must write

 Question 1 (10 points) Consider the following problem. A babysitter is

Question 1 (10 points) Consider the following problem. A babysitter is logging all the earnings they get for children they care for. You must write source code for classes that can be used in a calculator program to help this babysitter to tally their total earnings. The classes should be designed as follows: A BabySitter has a listing of children they care for called children, setter and getter functions for children, a function add_child() that takes a child argument and adds it to the list children, and a method get_total_earnings(). This method has no parameters and returns the computed total earnings over all children they supervised. A Child has setter and getter functions for its attributes rate and time_supervised, and a method compute_earnings(). This method returns the total earnings for babysitting for this child, based on rate and time_supervised. Note: Since this is OOP, each class needs an __init__() function. Paragraph >

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!