Question: 9.1.8 I'm not sure how to start. Please answer all parts using the given format. Thank you! For this exercise, you are going to design




For this exercise, you are going to design 3 classes: Computer - Superclass Laptop - Subclass Desktop - Subclass You will design these classes to optimize the superclass/subclass relationship by creating and getter/setter methods. Include the following instance variables: int screenSize - Inches of monitor space int memory - GB of ram double batteryLife - Hours of battery life boolean monitor - Whether or not a monitor is included Each class should have at least one variable in it. Once completed, the Tester class should execute without error. 31 A MacBook Pro 000 F2 20 F3 FO Sul 0 in FILES mec D Computer Tester java Computer java Laptop java uters Sove 1 public class Computer Tester 2. { 3 public static void main(String[] args) 4- 5 Laptop macBook - new LaptopO; 6 macBook.setBatteryLife(8.5): 7 8 Desktop dell - new Desktop; 9 dell.setScreensize(18); 10 11 Computer surface - new Computer; 12 surface.setScreenSize(11); 13 14 System.out.println(macBook.getBatteryLife(); 15 System.out.println(dell.getScreensize(); 16 System.out.println(surface.getScreensize(); 17 18) 19 D Desktop.java 1 Send 31 MacBook Pro SC # 2 3 4
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
