Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

private boolean data field name status that specifies if the computer is on or not (default is false)

private double data field name weight (default is 5.5)

private int data field named ram (default is 0)

Constructors

Default constructor:

public Computer()

public Computer(int r, String b)

public Computer(int r, String s, double w) (r is ram, s is the brand and w is the weight)

Methods

The accessor and mutator methods for all four data fields

A method named toString() that returns string description of the computer.

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 users input values of brand HP, 4 pounds, and 16G ram. Get users input for ram and brand to create C2 using second constructor. After that, get users input of weight for C2, and change C2s weight. Get users 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

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

Database Programming With Visual Basic .NET

Authors: Carsten Thomsen

2nd Edition

1590590325, 978-1590590324

More Books

Students also viewed these Databases questions

Question

Describe how social networking influences us.

Answered: 1 week ago

Question

What are Measures in OLAP Cubes?

Answered: 1 week ago

Question

How do OLAP Databases provide for Drilling Down into data?

Answered: 1 week ago

Question

How are OLAP Cubes different from Production Relational Databases?

Answered: 1 week ago