Problem

Designing ClassesDescribe the public methods, instance variables, private methods, static...

Designing Classes

Describe the public methods, instance variables, private methods, static methods, static variables, and/or constructors that you would use to implement the following classes.

a. A Cell Phone

• The phone is either on or off, and in-use or not in-use.

• The phone has its own phone number as well as a list of n frequently called numbers.

• The phone can display its own number as well as the list of frequently called numbers.

• You can “speed-dial” a frequently called number by providing an integer in the range 1 through n that indexes a stored phone number.

• You can determine whether or not the phone is ringing, and if so, answer the phone.

• If you make a call or answer a call, the phone is in-use.

• You can make a call only if the phone is not in-use.

• You can hang up the phone, and then it is not in-use.

• You can turn the phone on or off. If you turn it off you also hang up.

• Your phone remembers all numbers that you dial and stores them.

• You can view the list of numbers you have dialed.

• You can redial the most recently called number.


b. A Computer Speaker

• A speaker has a green LED that is either on or off.

• A speaker has a power switch that toggles the power.

• A speaker has a volume switch with 10 settings, 0–9 inclusive.

• A speaker has a color (black, gray, white).

• A speaker has a power rating (high, medium, and low).

• You can bump the volume up or down. Bumping up from 9 or down from 0 has no effect.

Step-by-Step Solution

Request Professional Solution

Request Solution!

We need at least 10 more requests to produce the solution.

0 / 10 have requested this problem solution

The more requests, the faster the answer.

Request! (Login Required)


All students who have requested the solution will be notified once they are available.
Add your Solution
Textbook Solutions and Answers Search
Solutions For Problems in Chapter 10
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT