Question: Write a Program to define a Mobile class, with member variables String brand; double price ( Should be non negative and greater than zero throw
Write a Program to define a Mobile class, with member variables
- String brand;
- double price ( Should be non negative and greater than zero throw exception otherwise)
- String OS (make it Final).
- Float memory
- Make a default constructor,
- Make a parameterized constructor.
- Overload the above Constructor.
- Provide getters and setters for data members.
Create another class mobile store that holds an arrayList of mobiles in the store note that it cannot have more than 3 mobiles of same brand.
- Provide appropriate methods also write method to save mobiles data to file ( Make sure if number of mobiles of one brands exceeds 3 it should throw an exception). And read from file.
- Design an application using JFrames which help adding new mobiles to the store.
- Buy a Mobile.( this should calculate and display bill plus receipt to user)
- Update a mobiles Data.
- Delete a mobile.
- View All mobiles
Note you can add member variables and method as per need.You have to do it in java
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
