Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Create a C++ program that only uses programming in chapters 1-13. Design, implement, and test a class that represents a phone number. The number should

Create a C++ program that only uses programming in chapters 1-13.
image text in transcribed
image text in transcribed
Design, implement, and test a class that represents a phone number. The number should be represented by a country code, an area code, a phone number, and a phone type. Please note that the phone number will be a long int because the maximum value that an int can hold is 32768 The type member is an enumeration of HOME, OFFICE, FAX, CELL, and PAGER. It will be stored separately in a file named Phonetype.h. Include preprocessor directives in case the file is included multiple times. See page 642 in your textbook. The Phone class should have . a default constructor that sets all of the integer values to zero and the type to HOME a constructor that enables all of the values to be set, and a constructor that takes just the phone number and type as arguments and sets the country code to 1 and the . area code to 731. The class will have observers that enable each data member to the retrieved and transformers that allow each data member to be changed Create another enumeration for the result of comparing two phone numbers. It should contain the values LESSTHAN. GREATERTHAN, and EQUAL. It will be stored separately in a file named PhoneRelationtype.h. Include preprocessor directives in case the file is included multiple times. See page 642 in your textbook. Two additional observers should be created: . One that compares two phone numbers and returns a PhoneRelationType and one that writes out the phone number in the format HOME 1 (731) 3521234 For this assignment, you will create and submit the following files: PhoneType.h . PhoneRelationType.h . Phone.h Phone.cpp In addition, I have provided a driver program that you must use to test your assignment. The program is and you can NOT change this program! You code must compile and work with this driver program. Click here

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

Time Series Databases New Ways To Store And Access Data

Authors: Ted Dunning, Ellen Friedman

1st Edition

1491914726, 978-1491914724

Students also viewed these Databases questions

Question

Define business research and describe its task.

Answered: 1 week ago