1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Lostsunrise [7]
3 years ago
11

Given a long integer representing a 10-digit phone number, output the area code, prefix, and line number using the format (800)

555-1212.
Computers and Technology
1 answer:
Alexxandr [17]3 years ago
8 0

Answer:

See explanation!

Explanation:

Here we have a program written in C++ language. Each // symbol is a relative comment explaining the reason for each command line (and is not included during the program execution).

<em>The Program: </em>

#include <iostream>

<em>//c++ build in library</em>

using namespace std;

<em>//main code body starts here</em>

int main()

{

 <em> //declare variable to store phone numbers,its area code, prefix and line    number.</em>

  long pnumber;   <em>//declare long variable</em>

  int ac, prefix, lnumber;

 <em> //declare integer variables, where ac: Area Code and lnumber is the Line Number</em>

  cout<<"Enter a 10-digit Phone Number: "<<endl;

  <em>//cout command prints on screen the desired message</em>

  cin>>pnumber;

 <em> //cin command enables the user to interact with the programm and enter information manually</em>

 <em> //main body to obtain the desired output starts below</em>

<em>   //each 'division' is used to allocate the correct value at the correct </em>

<em>   //since prefix is used to get the desired output of ( )    -</em>

  ac = pnumber/10000000;

  prefix = (pnumber/10000)%1000;

  lnumber = pnumber%10000;

 <em> //main body ends here</em>

  cout<<"Based on your 10-digit number"<<endl;

  cout<<"below you have (AreaCode), Prefix, and - line number "<<endl;

  cout<<"("<<ac<<")"<<""<<prefix<<"-"<<lnumber<<endl;

 <em> //Prints on screen the desired output of the long 10 digit Number</em>

  return 0;<em> //ends program</em>

}

-------------------------------------------------------------------------------------------------------

<em>The Output Sample:</em>

Enter a 10-digit Phone Number:

8019004673

Based on your 10-digit number

below you have (Area Code), Prefix, and - line number

(801) 900-4673

<em>....Programm finished with exit code 0</em>

You might be interested in
An increase in pay because of how well you do a job is called _____.
sleet_krkn [62]
It's either a raise or a promotion.
4 0
3 years ago
Read 2 more answers
What kind of cable would you use to connect a network printer to the soho router if you were using a wired connection to the net
Ksivusya [100]

Answer:

A) Ethernet

To Connect the Printer to a Wired (Ethernet) Network

<h3>what is the process of connecting a network printer to the SOHO router?</h3>
  • Connect one end of an Ethernet cable to the Ethernet port on the back of the printer, then connect the other end of the cable to a correctly configured network port, switch or router port.
  • Connect the Printer to a Router.

To learn more about ethernet, refer

to brainly.com/question/24621985

#SPJ4

4 0
2 years ago
A for loop is most useful for: A. executing some statements for a specific number of iterations B. executing some statements for
dsp73

Answer:

Option A and C

Explanation:

  • Loops are control structures used to rehash a given area of code a specific number of times or until a specific condition is met. Visual Basic has three principle sorts of circles: for..next circles, do circles and keeping in mind that circles.  
  • For loop is a programming language contingent iterative proclamation which is utilized to check for specific conditions and afterward over and over execute a square of code as long as those conditions are met.
4 0
3 years ago
Which two hardware features would a technician monitor within the bios if a computer was suspected of overheating?
Firdavs [7]
I would say probably the CPU Fan and the CPU clock speed 
4 0
3 years ago
An analyst determines the value of investments<br><br> True<br><br> False
satela [25.4K]
The correct answer is True
8 0
3 years ago
Read 2 more answers
Other questions:
  • What will be the value of i after the C statements at the right have been executed
    6·1 answer
  • When studying an information system, illustrations of actual documents should be collected using a process called _____.
    12·1 answer
  • Select the correct answer.
    12·2 answers
  • The company database may be stored on a central database server and managed by a database adminstrator true or false
    12·1 answer
  • _____ is a predefined format used for text the can include multiple font formatting features
    13·1 answer
  • Write a program that takes in a positive integer as input, and outputs a string of 1's and 0's representing the integer in binar
    13·1 answer
  • IPv6 is being developed in order to:
    15·1 answer
  • Each generation is set apart from the previous generation because of an innovation.
    6·1 answer
  • What do you do when ur grounded from all electronics and can't go outside and have t clean all day
    10·1 answer
  • Jorge, a sports statistician for soccer, has kept track of how many shots-on-goal each player on a team made in each game. This
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!