[SOLVED] Solution Chapter 12-6 PG. 639

25.00 $

Programming resource
Digital learning resource
Category:
Practical programming resource
Suitable for guided study and reference
Tutor guidance available when needed

Description

5/5 - (1 vote)

Design, implement, and test a class that represents a phone number. The number should be represented by a country code, an area code, a number, and a type. The first three values can be integers. The type member is an enumbberation of HOME, OFFICE, FAZ, CELL, and PAGER. The class should provide a default constructor that sets all of the integer values to zero and the type of HOME. A constructor that enables all values to be set should be provided as well. You also should provide a constructor that takes just the number and type as arguments, and sets the country and area codes to those of your location. The class will have observers that enable each data member to be retrieve, and transformers that allow each data member to be changed. An additional observer should be provided that compares two phone numbers for equality

 

Resource details

Understand the Task Before You Use the Resource

Review the requirements, identify the programming concepts involved, study the implementation and test your understanding with your own examples and modifications.