Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Description Modify your program from Assignment 3 that defined and tested a Computer class with a single hard drive to represent either a computer with

image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
Description Modify your program from Assignment 3 that defined and tested a Computer class with a single hard drive to represent either a computer with a mechanical hard drive or computer with a solid-state drive. Pay careful attention to any changes within each individual class The Computer class represents a single Computer. Every Computer contains one of two HardDrives: a separately manufactured MechanicalHardDrive with a platter speed or a SolidStateDrive with a specified interface type The Computer class (provided) contains: A String data member named manufacturer that sets the manufacturer for the Computer .A String data member named model that sets the model for the Computer .A HardDrive data member named hardDrive that contains a HardDrive instance. A default no-arg constructor that creates a default Computer. Use appropriate mutator methods in your constructors. If this constructor is called, a new HardDrive instance should be created and set as the HardDrive for the Computer o Default values should be "OEM" for manufacturer, "Generic" for model A constructor that allows the client to set the HardDrive (by passing a HardDrive instance), Computer manufacturer, and Computer model. Use the appropriate mutator methods Accessor and mutator methods for all data members. These methods should be used throughout the class as needed. A method named toString() that returns a String indicating the manufacturer, model, hardDrive's capacity, and the textual description of the hardDrive from its toString() method (capacity and toString() data should be retrieved from the HardDrive instance). See expected output for the needed format. The HardDrive class should contain: . An int data member named capacity that indicates the storage capacity in GB A String data member named type that indicates the type of hard drive A default no-arg constructor that creates a default HardDrive. Use appropriate mutato methods in your constructors. Default values should be 256 for capacity and "Mechanical" for ty o pe

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

The Structure Of The Relational Database Model

Authors: Jan Paredaens ,Paul De Bra ,Marc Gyssens ,Dirk Van Gucht

1st Edition

3642699588, 978-3642699580

More Books

Students also viewed these Databases questions

Question

Answered: 1 week ago

Answered: 1 week ago