Create a UML class hierarchy (three connected UML diagrams) that has all three classes you created above. Make sure each UML diagram is a one-to-one to the code, it matches the Java code exactly. Make sure that both Child Classes point to their Parent. Hint: your subclasses are siblings. Hint: You need to create three UML diagrams for three created Java classes and connect them using arrows, where each Child Class points to its Parent. You can either draw this by hand and take a picture or use a tool / software of your choice.  class Desktop extends Computer {     private int width;     private int height;     public Desktop() {         super();         width = height = 0;     }     public Desktop(String manufacturer, String diskSize, String manufacturingDate, int numberOfCores, int width, int height) {         super(manufacturer, diskSize, manufacturingDate, numberOfCores);         this.width = width;         this.height = height;     }     public int getWidth() {         return width;     }     public int getHeight() {         return height;     }     public void setWidth(int width) {         this.width = width;     }     public void setHeight(int height) {         this.height = height;     }     @Override     public String toString() {         return super.toString() + "\nWidth: " + width + " cm" + "\nHeight: " + height + " cm";     } }   class Laptop extends Computer {     private double weight;     public Laptop() {         super();         weight = 0.0;     }     public Laptop(String manufacturer, String diskSize, String manufacturingDate, int numberOfCores, double weight) {         super(manufacturer, diskSize, manufacturingDate, numberOfCores);         this.weight = weight;     }     public double getWeight() {         return weight;     }     public void setWeight(double weight) {         this.weight = weight;     }     @Override     public String toString() {         return super.toString() + "\nWeight: " + weight + " kg";     } }

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

Create a UML class hierarchy (three connected UML diagrams) that has all three classes you
created above. Make sure each UML diagram is a one-to-one to the code, it matches the Java
code exactly. Make sure that both Child Classes point to their Parent.
Hint: your subclasses are siblings.
Hint: You need to create three UML diagrams for three created Java classes and connect them
using arrows, where each Child Class points to its Parent. You can either draw this by hand and
take a picture or use a tool / software of your choice. 

class Desktop extends Computer {
    private int width;
    private int height;

    public Desktop() {
        super();
        width = height = 0;
    }

    public Desktop(String manufacturer, String diskSize, String manufacturingDate, int numberOfCores, int width, int height) {
        super(manufacturer, diskSize, manufacturingDate, numberOfCores);
        this.width = width;
        this.height = height;
    }

    public int getWidth() {
        return width;
    }

    public int getHeight() {
        return height;
    }

    public void setWidth(int width) {
        this.width = width;
    }

    public void setHeight(int height) {
        this.height = height;
    }

    @Override
    public String toString() {
        return super.toString() + "\nWidth: " + width + " cm" + "\nHeight: " + height + " cm";
    }
}

 

class Laptop extends Computer {
    private double weight;

    public Laptop() {
        super();
        weight = 0.0;
    }

    public Laptop(String manufacturer, String diskSize, String manufacturingDate, int numberOfCores, double weight) {
        super(manufacturer, diskSize, manufacturingDate, numberOfCores);
        this.weight = weight;
    }

    public double getWeight() {
        return weight;
    }

    public void setWeight(double weight) {
        this.weight = weight;
    }

    @Override
    public String toString() {
        return super.toString() + "\nWeight: " + weight + " kg";
    }
}

◆ eclipse-workspace - project2/src/project2/Computer.java - Eclipse IDE
File Edit Source Refactor Navigate Search Project Run Window Help
- 2
#C
Difference.java
2
95.
TestPrintPri...
1 package project2;
2
3
4
6
8
9
10C
11
12
13
14
15
16
17
Č===================
19
$20
21
22
23
24
25
26
$27
$28
29
830
31
32
33
36
38Ⓒ
39
40
41
42
class Computer
0
private String Manufacturer;
private String DiskSize/
private String ManufacturingDate;
private int NumberOfCores/
//no-arg constructor
public Computer ()
{
1
[
1
project.java
//parameterised constructor
public Computer (String Manufacturer, String DiskSize, String ManufacturingDate, int NumberOfCores)
Manufacturer - ManufacturingDate "";
DiskSize = "";
NumberOfCores - 0;
//Catter methods
this.Manufacturer - Manufacturer;
this.ManufacturingDate - ManufacturingDate;
this.DiskSize - DiskSize;
this.NumberOfCores NumberOfCores;
public String getManufacturer() { return Manufacturer; 1
//Setter methods
public String getManufacturingDate() { return ManufacturingDate: 1
public String getDiskSize() { return DiskSize: 1
public int get NumberOfCores () { return NumberOfCores; 1
1
49°F
Clear
public void setManufacturer (String x) [ Manufacturer - x; 1
public void setManufacturingDate (String x) [ ManufacturingDate - x; }
public void setDiskSize(String x) [DiskSize - x: 1
public void setNumberOfCores (int x) [NumberOfCores - x: 1
Table.java
▬▬
▬▬▬
↓
MoreArith.java
public String tostring()
{
return "Manufacturer: " + Manufacturer + "\nManufacturing Date: " + ManufacturingDate + "\nDisk Size: " + DiskSize + "bytes" + "\nNumber of Cores: " + NumberOfCores;
Q Search
♡ ♡
Herjames_Pr...
Writable
Computer.java X TestCompute...
a
Smart Insert
42:2:1474
Desktop.java
Laptop.java
89
a
8:03 PM
4/3/2023
X
* * * + @ 隐旦
8
%
鼎
2
@
@
Transcribed Image Text:◆ eclipse-workspace - project2/src/project2/Computer.java - Eclipse IDE File Edit Source Refactor Navigate Search Project Run Window Help - 2 #C Difference.java 2 95. TestPrintPri... 1 package project2; 2 3 4 6 8 9 10C 11 12 13 14 15 16 17 Č=================== 19 $20 21 22 23 24 25 26 $27 $28 29 830 31 32 33 36 38Ⓒ 39 40 41 42 class Computer 0 private String Manufacturer; private String DiskSize/ private String ManufacturingDate; private int NumberOfCores/ //no-arg constructor public Computer () { 1 [ 1 project.java //parameterised constructor public Computer (String Manufacturer, String DiskSize, String ManufacturingDate, int NumberOfCores) Manufacturer - ManufacturingDate ""; DiskSize = ""; NumberOfCores - 0; //Catter methods this.Manufacturer - Manufacturer; this.ManufacturingDate - ManufacturingDate; this.DiskSize - DiskSize; this.NumberOfCores NumberOfCores; public String getManufacturer() { return Manufacturer; 1 //Setter methods public String getManufacturingDate() { return ManufacturingDate: 1 public String getDiskSize() { return DiskSize: 1 public int get NumberOfCores () { return NumberOfCores; 1 1 49°F Clear public void setManufacturer (String x) [ Manufacturer - x; 1 public void setManufacturingDate (String x) [ ManufacturingDate - x; } public void setDiskSize(String x) [DiskSize - x: 1 public void setNumberOfCores (int x) [NumberOfCores - x: 1 Table.java ▬▬ ▬▬▬ ↓ MoreArith.java public String tostring() { return "Manufacturer: " + Manufacturer + "\nManufacturing Date: " + ManufacturingDate + "\nDisk Size: " + DiskSize + "bytes" + "\nNumber of Cores: " + NumberOfCores; Q Search ♡ ♡ Herjames_Pr... Writable Computer.java X TestCompute... a Smart Insert 42:2:1474 Desktop.java Laptop.java 89 a 8:03 PM 4/3/2023 X * * * + @ 隐旦 8 % 鼎 2 @ @
➡ eclipse-workspace - project2/src/project2/TestComputer.java - Eclipse IDE
File Edit Source Refactor Navigate Search Project Run Window Help
- 2
C
95.
TestPrintPri...
1 package project2;
2 public class TestComputer
3
4
5
6
7
8
9
25
26 }
27
28
project.java
{
public static void main(String[] args) {
29
30 |
10
11
12
13
14
15
16 System.out.println (11);
17 System.out.println();
18 System.out.println (12);
19
20 System.out.println("\nDesktops....");
21 System.out.println(dl);
22 System.out.println();
23
System.out.println (d2);
24
}
#
Difference.java
49°F
Clear
//Two new Desktop
Desktop dl = new Desktop ("Microsoft",
Desktop d2 = new Desktop ("Apple Inc",
//Printing the details
System.out.println("Laptops....");
//Two new laptops
Laptop 11 = new Laptop ("Dell", "1122334455", "April 1, 2020", 4, 5);
Laptop 12 = new Laptop ("Apple Inc", "222222222", "May 15, 2022", 8, 7);
▬▬
▬▬▬
Table.java
MoreArith.java
Q Search
▾▾ ♡
Herjames_Pr...
"1122334455", "August 13, 2019", 4, 20, 30);
"222222222", "December 05, 2022", 8, 25, 35);
Writable
a
- P
Computer.java
Smart Insert
TestCompute... XDesktop.java
30:1:777
Laptop.java
89
a
O
X
* * * + @ 隐旦
8
%
鼎
2
@
@
8:37 PM
4/4/2023
Transcribed Image Text:➡ eclipse-workspace - project2/src/project2/TestComputer.java - Eclipse IDE File Edit Source Refactor Navigate Search Project Run Window Help - 2 C 95. TestPrintPri... 1 package project2; 2 public class TestComputer 3 4 5 6 7 8 9 25 26 } 27 28 project.java { public static void main(String[] args) { 29 30 | 10 11 12 13 14 15 16 System.out.println (11); 17 System.out.println(); 18 System.out.println (12); 19 20 System.out.println("\nDesktops...."); 21 System.out.println(dl); 22 System.out.println(); 23 System.out.println (d2); 24 } # Difference.java 49°F Clear //Two new Desktop Desktop dl = new Desktop ("Microsoft", Desktop d2 = new Desktop ("Apple Inc", //Printing the details System.out.println("Laptops...."); //Two new laptops Laptop 11 = new Laptop ("Dell", "1122334455", "April 1, 2020", 4, 5); Laptop 12 = new Laptop ("Apple Inc", "222222222", "May 15, 2022", 8, 7); ▬▬ ▬▬▬ Table.java MoreArith.java Q Search ▾▾ ♡ Herjames_Pr... "1122334455", "August 13, 2019", 4, 20, 30); "222222222", "December 05, 2022", 8, 25, 35); Writable a - P Computer.java Smart Insert TestCompute... XDesktop.java 30:1:777 Laptop.java 89 a O X * * * + @ 隐旦 8 % 鼎 2 @ @ 8:37 PM 4/4/2023
Expert Solution
steps

Step by step

Solved in 3 steps with 1 images

Blurred answer
Knowledge Booster
Class
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education