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
Que significa el término “Informática”?
Ad libitum [116K]

Answer:

Explanation:

proviene del francés informatique, implementado por el ingeniero Philippe Dreyfus a comienzos de la década del '60. ... De esta forma, la informática se refiere al procesamiento automático de información mediante dispositivos electrónicos y sistemas computacionales.

4 0
3 years ago
The operating systems, and utility programs that perform system
Phantasy [73]

Answer:

System softwares.

Explanation:

A software can be defined as a set of executable instructions (codes) or collection of data that is used typically to instruct a computer how to perform a specific task and to solve a particular problem.

Basically, softwares are categorized into two (2) main categories and these are;

I. Utility software.

II. System software.

The operating systems, and utility programs that perform system maintenance and protection tasks such as error correction and backup are called system softwares.

An operating system is a system software pre-installed on a computing device to manage or control software application, computer hardware and user processes.

This ultimately implies that, an operating system acts as an interface or intermediary between the computer end user and the hardware portion of the computer system (computer hardware) in the processing and execution of instructions.

Some examples of an operating system on computers are QNX, Linux, OpenVMS, MacOS, Microsoft windows, IBM, Solaris, VM etc.

On the other hand, a utility software can be defined as a software application or program designed to add more functionality to a computer system, as well as to improve its performance efficiently. Some examples of commonly used utility tools in computer are file and folder backup tools, file management, antivirus, hard disk diagnostics, registry cleaner, network performance monitor, screensavers etc.

4 0
2 years ago
Using Matlab programming I need to rotate the line defined by x,y by 45 degrees around 2,2
belka [17]

Answer:

% here x and y is given which we can take as

x = 2:2:10;

y = 2:2:10;

% creating a matrix of the points

point_matrix = [x;y];

%  center point of rotation  which is 2,2 here

x_center_pt = x(2);

y_center_pt = y(2);

% creating a matrix of the center point

center_matrix = repmat([x_center_pt; y_center_pt], 1, length(x));

% rotation matrix with rotation degree which is 45 degree

rot_degree = pi/4;      

Rotate_matrix = [cos(rot_degree) -sin(rot_degree); sin(rot_degree) cos(rot_degree)];

% shifting points  for the center of rotation to be at the origin

new_matrix = point_matrix - center_matrix;  

% appling rotation  

new_matrix1 = Rotate_matrix*new_matrix;          

Explanation:

We start the program by taking vector of the point given to us and create a matrix by adding a scaler to each units with repmat at te center point which is (2,2). Then we find the rotation matrix by taking the roatational degree which is 45 given to us. After that we shift the points to the origin and then apply rotation ans store it in a new matrix called new_matrix1.

4 0
3 years ago
Why is it important to think about the programming language to use?
Sloan [31]
In think is C or B in my opinion
6 0
3 years ago
What OC level is primarily used as a regional isp backbone, and occasionally by very large hospitals, universities, or other maj
Neporo4naja [7]

The OC level is primarily used as a regional ISP backbone, and occasionally by very large hospitals, universities, or other major enterprises is <u>OC-48.</u>

<u></u>

<h3>What is the greatest amount of throughput provided by an OC 12?</h3>

OC-12 is a network line with communication speeds of up to 622.08 Mbit/s (payload: 601.344 Mbit/s; overhead: 20.736 Mbit/s). OC-12 lines are generally used by ISPs as wide area network (WAN) connections.

<h3>When using frame relay What is the appellation of the identifier?</h3>

A data-link connection identifier (DLCI) determines the Frame Relay PVC. Frames are routed through one or more virtual circuits determined by DLCIs.

Each DLCI has a permanently configured switching path to a particular destination

To learn more about OC level , refer

brainly.com/question/25899244

#SPJ4

<u></u>

5 0
1 year ago
Other questions:
  • Which statement is true about the elements of the interface of a presentation program? The status bar appears at the top of the
    14·2 answers
  • Explain each of the three important concepts behind the Federal Networking Council's definition of the term Internet. Explain ho
    8·1 answer
  • For what kind of shot is a fisheye lens most appropriate?
    8·1 answer
  • To filter a list with the Filter function, on an Excel spreadsheet, you need to perform the following steps: (1) click in any ce
    9·1 answer
  • Consider the following code: // Merge mailing list m2 into m1 void merge (MailingList m1, MailingList m2) { for (int i = 0; i &l
    12·1 answer
  • Please help me ASAP
    6·1 answer
  • How to get bing with any node unblocker
    10·2 answers
  • Is there any difference beetween the old version of spyro released on the origional and the newer ones??? or is it only change i
    8·1 answer
  • Jeroo Bob has just awoken from a long night's sleep and is hungry for some winsum flowers. He walks out of
    7·1 answer
  • Polynomial regression A common misconception is that linear regression can only be used to fit a linear relationship. We can fit
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!