Question: 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:

  1. Main class

Has the main method and tests the other classes.

  1. Computer
    1. We are storing the following information about our computers
      1. CPU type
      2. CPU speed
      3. RAM size
  2. Laptop
    1. We are storing the following information about our laptops
      1. All the information we have in the computer
      2. Battery life in hours
      3. The current battery level (hours remaining).
    2. Charge method that sets the battery level to the max level.
  3. Desktop
    1. We are storing the following information about our laptops
      1. All the information we have in the computer
      2. Number of screens

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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!