Question
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
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
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started