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

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!