Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

The system should have three classes: Computer , PC and Mac . Computer is the parent of other classes. Computer defines certain fields, such as

The system should have three classes: Computer, PC and Mac. Computer is the parent of other classes.

Computer defines certain fields, such as year(int), os_version(string) and brand (string). These variables have their setters and getters defined.

PC, has an extra field of OS (string) which can either be 'Linux' or 'Windows'. Use exception handling to prevent other values.

Mac has an extra field named Retina (boolean), which is either true or false depending on the display type the Mac has.

Once you create these classes write your test class with main method. Create PC and Mac objects, Assign them into a Computer array of 2 elements. Then use a for loop to display their information.

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_2

Step: 3

blur-text-image_3

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

Beginning VB 2008 Databases

Authors: Vidya Vrat Agarwal, James Huddleston

1st Edition

1590599470, 978-1590599471

More Books

Students also viewed these Databases questions

Question

2. What type of team would you recommend?

Answered: 1 week ago

Question

Provide examples of KPIs in Human Capital Management.

Answered: 1 week ago

Question

What are OLAP Cubes?

Answered: 1 week ago