The world’s Largest Sharp Brain Virtual Experts Marketplace Just a click Away
Levels Tought:
Elementary,Middle School,High School,College,University,PHD
| Teaching Since: | Jul 2017 |
| Last Sign in: | 304 Weeks Ago, 2 Days Ago |
| Questions Answered: | 15833 |
| Tutorials Posted: | 15827 |
MBA,PHD, Juris Doctor
Strayer,Devery,Harvard University
Mar-1995 - Mar-2002
Manager Planning
WalMart
Mar-2001 - Feb-2009
USE PYTHON 3 ONLY
1. Create a class Inventory.
2. Create attribute (class variable), totalInventory = 0.
4. Create an __init__ method has the following default values for name, price, quantity:
“Unknown”, 0.0, and 0. Create instance variables for name, price, and quantity, and total (Hint: use self.total = 0).
Create the following attributes (instance variables) for the class:
String name # holds string data
price # holds floating point data
quantity # holds integer data
total # holds floating point data
5. Create a method named value_stock that will calculate the total as the quantity*price
6. Create a method __str__ that returns a string that displays the name and total.
7. Instantiate an object flash_drive_8gb with “USB Flash Drive”, 12.99, and 40.
8. Call the value_stock method for the flash_drive_8gb object.
9. Print the flash_drive_8gb object
----------- ----------- H-----------ell-----------o S-----------ir/-----------Mad-----------am ----------- Th-----------ank----------- yo-----------u f-----------or -----------you-----------r i-----------nte-----------res-----------t a-----------nd -----------buy-----------ing----------- my----------- po-----------ste-----------d s-----------olu-----------tio-----------n. -----------Ple-----------ase----------- pi-----------ng -----------me -----------on -----------cha-----------t I----------- am----------- on-----------lin-----------e o-----------r i-----------nbo-----------x m-----------e a----------- me-----------ssa-----------ge -----------I w-----------ill----------- be----------- qu-----------ick-----------ly