1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
marshall27 [118]
3 years ago
11

Design 3 classes: Computer - Superclass

Computers and Technology
1 answer:
wlad13 [49]3 years ago
5 0

Answer:

Explanation:

The following code is written in Java. It creates the three classes mentioned and a Tester class that contains the main method. The Computer class contains the memory variable since both laptops and Desktops need memory. The screen size variable is placed separately in the Laptop and Desktop class since desktops may or may not have a monitor so this variable cannot be placed in the Computer class. The batteryLife variable is only in the Laptop class because Desktops do not have batteries. Finally, the monitor variable is only placed in the Desktop class since Laptop's come with built-in monitors. The tester class seen in the picture below tests the creation of both of these objects and it executes without any error.

class Computer {

   int memory;

   public int getMemory() {

       return memory;

   }

   public void setMemory(int memory) {

       this.memory = memory;

   }

}

class Laptop extends Computer {

   int screenSize;

   double batteryLife;

   public int getScreenSize() {

       return screenSize;

   }

   public void setScreenSize(int screenSize) {

       this.screenSize = screenSize;

   }

   public double getBatteryLife() {

       return batteryLife;

   }

   public void setBatteryLife(double batteryLife) {

       this.batteryLife = batteryLife;

   }

}

class Desktop extends Computer {

   boolean monitor;

   int screenSize;

   public boolean isMonitor() {

       return monitor;

   }

   public void setMonitor(boolean monitor) {

       this.monitor = monitor;

   }

   public int getScreenSize() {

       return screenSize;

   }

   public void setScreenSize(int screenSize) {

       this.screenSize = screenSize;

   }

}

class Tester {

   public static void main(String[] args) {

       Laptop computer1 = new Laptop();

       Desktop computer2 = new Desktop();

   }

}

You might be interested in
Sonic the Hedgehog (1991)
e-lub [12.9K]

Answer:

What if we made a fast game?

Explanation:

The mascot is the person, animal or thing which brings good luck, just like Mario. However, this is not a problem with Sonic the Hedgehog. And the Hedgehog is powerful enough to cross any barrier. Hence tieing the collectibles is not required. And the Hedgehog is quite cute and domestic. But it moves only 10 meters per second if we are considering the maximum speed. Hence, the correct option is certainly what if we made a fast game? And this is option C.

7 0
3 years ago
A group of users can perform certain operations on a shared workbook. Which option helps them to update and track changes in the
irina1246 [14]

The “Allow changes by more than one user at the same time” option.


In a group of users, it is very important to create a shared workbook so that several people are able to update information and track changes in the workbook at the same time. To do so, one should click on the review tab of the excel sheet and select share workbook. On the editing tab of the share workbook dialog box, select the Allow changes by more than one user at the same time check box. Go ahead and click the advanced tab and select option you would want to use and then click OK

 






4 0
3 years ago
When replacing a system board in a laptop, which feature is a must?
Marta_Voda [28]

Answer:

Having the integrated peripherals in the same locations as the old system board

Explanation:

System board is the printed circuit board that is used to connect the peripheral devices. It provides the slots and ports to connect the peripherals devices.

If there is a need to replace the system board of the laptop. You can change the system board. On new system board, all the peripherals that are installed on previous (old) system board should be placed on new system board. As the system requirements are same, only printed circuit board of the system is changed.

The new system board is replica of the previous board so, we can not change peripheral of the system boards.

5 0
3 years ago
During which step of the problem-solving process would group members combine and elaborate on ideas? Define the problem. Analyze
slava [35]

In a problem-solving process occurring inside a group, (C) develop creative solutions would be where the members combine and elaborate on ideas.

Brainstorming would be a prominent feature during this process since group members would be encouraged to state her or his opinion and solutions about the problem that the group needs to solve.

5 0
3 years ago
domain controllers store local user accounts within a sam database and domain user accounts within active directory. true or fal
Natalka [10]

Answer:

True

Explanation:

The domain controller is a server that responds within windows server domains to request for security authentication. It enforces security for windows and they are useful for storing the account information of users, that is local users within a Security Account Manager. Therefore the answer to this question is true.

Thank you!

5 0
2 years ago
Other questions:
  • A simple operating system supports only a single directory but allows it to have arbitrarily many files with arbitrarily long fi
    13·1 answer
  • Differentiate among web apps, mobile apps, and mobile web apps.
    14·2 answers
  • The voluntary linkage of computer networks around the world is called the ______.
    7·1 answer
  • The most fundamental components of storage that users interact with are the:
    11·1 answer
  • HELP URGENT
    12·2 answers
  • What does remedy mean
    7·2 answers
  • The instructions in the language of alice are contained on ____ which you can drag and drop into place to ____ new programs
    8·1 answer
  • It is a JavaScript property used to call a function after a specified time, in milliseconds​
    9·2 answers
  • Which tool ia used to create the world wide web?
    15·1 answer
  • What's the commission payout for auto bill pay if sold with a ga?
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!