Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Programmed in Java, please use inheritance, as that is the part i'm confused on. Thanks! For this lab you are creating 4 classes: Main class
Programmed in Java, please use inheritance, as that is the part i'm confused on. Thanks!
For this lab you are creating 4 classes:
- Main class
Has the main method and tests the other classes.
- Computer
- We are storing the following information about our computers
- CPU type
- CPU speed
- RAM size
- We are storing the following information about our computers
- Laptop
- We are storing the following information about our laptops
- All the information we have in the computer
- Battery life in hours
- The current battery level (hours remaining).
- Charge method that sets the battery level to the max level.
- We are storing the following information about our laptops
- Desktop
- We are storing the following information about our laptops
- All the information we have in the computer
- Number of screens
- We are storing the following information about our laptops
Write the appropriate constructors, getters and setters in each class.
In your main class create a laptop with an I7 10 generation 3.5 GHZ CPU, 16 GB of RAM and a battery that lasts 10 hours.
You will also need to create a Desktop with the same specs that has 2 screens.
Use the toString method to print the details for your laptop and desktop.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started