Write a class named Mobile that holds data about a mobile in a retail store. The class should have the following member variables: Name/brand. A string that holds name of the brand of phone. unitsOnHand. An int that holds the number of units currently in inventory. price. A double that holds the retail price. Write a constructor that accepts arguments fo
OOPs
In today's technology-driven world, computer programming skills are in high demand. The object-oriented programming (OOP) approach is very much useful while designing and maintaining software programs. Object-oriented programming (OOP) is a basic programming paradigm that almost every developer has used at some stage in their career.
Constructor
The easiest way to think of a constructor in object-oriented programming (OOP) languages is:
Write a class named Mobile that holds data about a mobile in a retail store. The class should have the following member variables:
- Name/brand. A string that holds name of the brand of phone.
- unitsOnHand. An int that holds the number of units currently in inventory.
- price. A double that holds the retail price.
Write a constructor that accepts arguments for each member variable, appropriate functions that store values in these member variables, and accessor functions that return the values in these member variables.
Once you have written the class,
Write another class Store (link list) having Mobile as a node then provide function to insert new mobile in list and to Delete a mobile and to display all mobiles.
Write a main program that shows all the functionality.
Note: you have to implement all scenarios (insert and delete at start, end, in between).
Step by step
Solved in 2 steps with 2 images