Given three int variables that have been given values, areaCode, exchange, and lastFour, write a string expression whose value is the string equivalent of each these variables joined by a single hyphen (-) So if areaCode, exchange, and lastFour, had the values 800, 555, and 1212, the expression's value would be "800-555-1212". Alternatively, if areaCode, exchange, and lastFour, had the values 212, 867 and 5309 the expression's value would be "212-867-5309".

Question
Asked Sep 21, 2019
123 views

Given three int variables that have been given values, areaCodeexchange, and lastFour, write a string expression whose value is the string equivalent of each these variables joined by a single hyphen (-) So if areaCodeexchange, and lastFour, had the values 800, 555, and 1212, the expression's value would be "800-555-1212". Alternatively, if areaCodeexchange, and lastFour, had the values 212, 867 and 5309 the expression's value would be "212-867-5309".

check_circle

Expert Answer

Step 1

As you have not specified the programming language, we are solving this question using C++ programming language.

Step 2

Source Code

#include <iostream>

using namespace std;

int main()

{

    int areaCode, exchange, lastFour;

    cout<<"Enter 3 digit area code"<<endl;

    cin>>areaCode;

    cout<<"Enter 3 digit exchange number"<<endl;

    cin>>exchange;

&nb...

Want to see the full answer?

See Solution

Check out a sample Q&A here.

Want to see this answer and more?

Solutions are written by subject experts who are available 24/7. Questions are typically answered within 1 hour.*

See Solution
*Response times may vary by subject and question.
Tagged in

Engineering

Computer Science

Object Oriented Programming

Related Computer Science Q&A

Find answers to questions asked by student like you
Show more Q&A
add
question_answer

Q: In C++ 1.  Create function called DoubleFillArray that takes in an empty array of size 100 and fills...

A: Program Instructions:In function DoubleFillArray, use rand() method to fill random numbers with doub...

question_answer

Q: ________ analyze the business situation and identify the need for information and information servic...

A: DescriptionSystem AnalystsSystem Analysts are those who basically works with the users as well as th...

question_answer

Q: In C++ Create a function called MultyDieRoll. It should take in an integer and run the function DieR...

A: As you have not specified the definition of DieRoll(), we are doing this question taking the value o...

question_answer

Q: In C++  1. Create function called DoubleFillArray that takes in an empty array of size 100 and fills...

A: Program Instructions:In function DoubleFillArray, use rand() method to fill random numbers with doub...

question_answer

Q: Eliminate all unit-productions from the grammar in S → a |aA| B|C, A → aB|λ, B → Aa, C → cCD, D → dd...

A: Let us start to define unit production and how can we remove unit productions.Unit production:- A un...

question_answer

Q: Read in 5 numbers from the keyboard and, if any of the entered numbers is &lt; 0, then print out “Ne...

A: Pseudo code is given below to read five numbers from the keyboard and print “Negative” if the number...

question_answer

Q: Show the binary representation for the phrase " University of Akron."

A: Binary is a base 2 system that uses only two digits 1 or 0. Computer store data and perform operatio...

question_answer

Q: What is it when they say 4g or 5g phone network

A: The usage of 4G or 5G defines that the mobile phone includes 4G or 5G network for the communication....

question_answer

Q: Weighted Intervals Problem EXAMPLE:Suppose we have the following weighted intervals. start   finish ...

A: Instructions for solving the problem.Sort the given intervals by finish time, and the intervals with...