Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Can you write out the Python for Problem 9.22. Programming Exercises 501 P.21 After closing time, the store manager wou ld like to know how

Can you write out the Python for Problem 9.22.

image text in transcribed

Programming Exercises 501 P.21 After closing time, the store manager wou ld like to know how much business was ister class to enable this functionality the total amount of all sales and the number of sales. Supply a method resetsales that resets any counters and transacted during the day. Modify the CashRegi Supply methods getsalesTotal and getSalesCount to get t totals so that the next day's sales start from zero. 22 Implement a class Portfolio. This class has two objects, checking and savings, of the type Bankaccount that was developed in Worked Example 9.1 (chos/bankaccount.py in your code files). Implement four methods: . def deposit(self, amount, account) e def withdraw(self, anount, account) def transfer(self, amount, account) . def getBalance(self, account) Here the account string is "s or "C. For the deposit or withdrawal, it indicates which account is affected. For a transfer, it indicates the account from which the money is taken; the money is automatically transferred to the other account. Design and implement a class Country that stores the name of the country, its popula- tion, and its area. Then write a program that reads in a set of countries and prints s P9.23 siness . . " The country with the largest area. The country with the largest population. The country with the largest population density (people per square kilometer (or mile)). Design a class M essage that models an e-mail message. A message has a recipient, a s P9.24 . A constructor that takes the sender and recipient . A method append that appends a line of text to the message body A method toString that makes the message into one long string like this: "From Harry Morgan To: Rudolf Reindeern.." Write a program that uses this class to make a message and print it. 25 Design a class Mailbox that stores e-mail messages, using the Message class of Exercise P9.24. Implement the following methods o def addMessage(self, message) e def getMessage(self, index)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Professional SQL Server 2012 Internals And Troubleshooting

Authors: Christian Bolton, Justin Langford

1st Edition

1118177657, 9781118177655

More Books

Students also viewed these Databases questions