Question: You design a class named Computer. This class needs to have following member variables and member methods Member Variables private String data field named brand
You design a class named Computer. This class needs to have following member variables and member methods Member Variables private String data field named brand ivate boolean data field name status that specifies if the computer is on or not (default is false) ivate double data field name weight default is 5.5) ivate int data field named ram default is 0) fault constructor blic Computer) blic Computer(int r, String b) blic Computer int r, String s, double w) (r is ram, s is the brand and w is the nt) e accessor and mutator methods for ethods Il four data fields A method named toString0 that returns tion of the er You need to implement a TestComputer class. In this Test class, you need to create three Computer objects (C1, C2, and C3) using different constructors. Change the value of C1 (created by default) with user's input values of brand HP, 4 pounds, and 16G ram. Get user's input for ram and brand to create C2 using second constructor. After that, get user's input of weight for C2, and change C2's weight. Get user's input for ram, brand and weight to create C3 using third constructor. Display objects by invoking their toString method Create a class diagram in UML notation
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
