Question
Please help with Python 3: 1. A GirlScout constructor takes two arguments, name and num_cookies_sold . The default value of num_cookies_sold is 0. It has
Please help with Python 3:
1. A GirlScout constructor takes two arguments, name and num_cookies_sold. The default value of num_cookies_sold is 0. It has two additional methods.
a) badge_earned() that returns True if the Girl Scout has sold 100 or more cookies and False otherwise.
b) cookies_sold() returns a string of the form "{Scout's name} has sold {number} cookies"
2. Cookies is a class that keeps track of how many of each kind of cookie has been sold. Its constructor takes no arguments.
a) add_type(cookie_name) instructs the object to begin tracking sales of cookie_name cookies. When a new cookie is tracked, its sales are initialized to 0
b) update_sales(cookie_name, num_sold) adds num_sold to cookie_name's sales
c) print_sales() prints a report of sales for each cookie, one cookie per line. Each cookie's report is of the form "{cookie's name}: {number sold}"
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