Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Write a class Telephone Number that will hold a telephone number. An object of t

ID: 3683125 • Letter: W

Question

Write a class Telephone Number that will hold a telephone number. An object of this class will have the following attributes: area Code - a three-digit integer exchange Code - a three-digit integer number - a four-digit integer This class will also have the following method. Telephone Number () - A constructor that takes a String of the form xxx-xxx-xxxx OR xxx-xxxx if the area code is missing. Throw an exception if the input format is not valid. toString - returns a string in either of the two formats shown previously for the constructor. Using a text editor (e.g. notepad), create a text file of several telephone number, using the two formats described previously. Write a program Telephone Reader that reads this file, displays the data on the screen. Finally: Submit both files to the dropbox

Explanation / Answer

#include <iostream>
#include <string>

std::array<int,4> global;

class Telephonenumber
{
std::array<int,3> area={12,23,45};
std::array<int,3> exchangecode={11,2,245};
std::array<int,4> number={12,23,45.2};
Telephonenumber()
{

}
};
int main()
{

  
try
{
Telephonenumber t();
}

catch(data_error& se)
{
std::cerr << "data not available" ;
}
return 0;
}

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote