HW1
- Create a class called Mobile
- Create 4 properties manufacture,operating system, model, cost
- Create a constructor that takes above 4 properties and initialize them
- Create another constructor that takes above 2 properties manufacture and operation systems only and initialize them
- Create a toString override method and print the Manufacture, Operating System, Model and Cost info
- Create a Android Class that inherits Mobile class
- Create two constructors with 4 arguments and another constructor with 2 arguments
- Create a BlackBerry Class that inherits Mobile class
- Create two constructors which takes 4 arguments and another constructor with 2 arguments
- On the Main Class
- Initialize all three classes and call appropriate methods
- To string method example:
public String toString() {
return "No of gears are " + this.gear + "\nspeed of bicycle is " + this.speed;
}
- Expected output
How to submit Homework?
- Add your full name and email at the top of the file using a comment tag.
- Compile and run your program, entering the required inputs.
- Take a screenshot of the result.
- Zip your project with the source code, then upload it on Blackboard.
- Upload screenshot on Blackboard.
Note: Submit the assignment on Blackboard by the due date. Email and late submissions will not be accepted.
Due Date :06/07/2023 12:00 PM