Write a code using abstract data types, classes, and inheritance methods. Creating the Cell Phone Class Wireless Solutions, Inc. is a business that sells cell phones and wireless service. You are a...

1 answer below »

Write a code using abstract data types, classes, and inheritance methods.



Creating the Cell Phone Class


Wireless Solutions, Inc. is a business that sells cell phones and wireless service. You are a programmer in the company's IT department, and your team is designing a program to manage all of the cell phones that are in the inventory. You have been asked to design a class that represents a cell phone. The data that should be kept as attributes in the class are as follows:



  • The name of the phone's manufacturer will be assigned to the __manufact attribute.

  • The phone's model number will be assigned to the __model attribute

  • The phone's retail price will be assigned to the __retail_price attribute


The class will also have the following methods:



  • An __init__ method that accepts arguments for the manufacturer, model number, and retail price.

  • A set_manufact method that accepts an argument for the manufacturer. This method will allow us to change the value of the __manufact attribute after the object has been created, if necessary.

  • A set_model method that accepts an argument for the model. This method will allow us to change the value of the __model attribute after the object has been created, if necessary.

  • A set_retail_price method that accepts an argument for the retail price. This method will allow us to change the value of the __retail_price attribute after the object has been created, if necessary.

  • A get_manufact method that returns the phone's manufacturer

  • A get_model method that returns the phone's model number

  • A get_retail_price method that returns the phone's retail price

  • A save_to_file method to save each user entry of manufacturer, model, and price to a text or spreadsheet file


The CellPhone Class will be imported into several programs that your team is developing. To test the class, write a code that prompts the user for the phone's manufacturer, model number, and retail price. Make sure you create an outer loop to ask the user if they want to continue entering phones into the 'database', once the user quits, display all the data existing in the file saved in the class method. An instance of the CellPhone class is created, and the data is assigned to its attributes.


The program output should look likes this: dont use the answers in the example


Enter the manufacturer: Google


Enter the model number: Pixel 4a


Enter the retail price: $500


Here is the data that you entered:


Manufacturer: Google


Model Number: Pixel 4a


Retail Price: $500.00


Do you want to continue adding phones to the database?


When user quits, display all data saved in the file so far

Answered Same DayFeb 25, 2022

Answer To: Write a code using abstract data types, classes, and inheritance methods. Creating the Cell Phone...

Neha answered on Feb 26 2022
107 Votes
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here