Question: PC -brand : String -speed: double + PCO + PC (b: String, s: double) + setBrand[b: String):void + setSpeed(s: double): void + getBrand()-String #getSpeedo:double 1-


PC -brand : String -speed: double + PCO + PC (b: String, s: double) + setBrand[b: String):void + setSpeed(s: double): void + getBrand()-String #getSpeedo:double 1- Write a class declaration for PC class and add the two variables to the class declaration brand: This field is a String variable that holds the PC brand. speed: This field is a double variable that holds the processor speed of a PC. 2- The class should have the following constructors: A constructor that accepts the following value as argument and assigns it to the appropriate fields: brand and speed. Ano-arg constructor that assigns an empty strings (") to the brand, and 0.0 to the speed eld. 3- Write mutator methods that store values in these fields and accessor methods that return the values in these fields as in above UML diagram. 4. Once you have written the class, write a separate program that creates two PC objects to hold the following data: + getSpeedo:double 1- Write a class declaration for PC class and add the two variables to the class declaration brand: This field is a String variable that holds the PC brand. speed: This field is a double variable that holds the processor speed of a PC. 2- The class should have the following constructors: A constructor that accepts the following value as argument and assigns it to the appropriate fields: brand and speed. A no-arg constructor that assigns an empty strings to the brand, and 0.0 to the speed field. 3- Write mutator methods that store values in these fields and accessor methods that return the values in these fields as in above UML diagram. 4. Once you have written the class, write a separate program that creates two PC objects to hold the following data: brand speed HP 2.6 Dell 2.1
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
