# 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
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

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

#### 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