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
Write a program that prompts the user to enter two positive integers less than 1,000,000,000 and the program outputs the sum of
alexira [117]

Answer:

In Python:

low = int(input("Low: "))

high = int(input("High: "))

if low >= 1000000000 or high >=1000000000:

   print("Out of range")

else:

   mylist = []

   for num in range(low,high+1):

       flag = False

       if num > 1:

           for i in range(2, num):

               if (num % i) == 0:

                   flag = True

                   break

       if not flag:

           mylist.append(num)

           print(num, end = " ")

   print()

   print("The twin primes are: ",end="")

   count = 0

   for i in range(1,len(mylist)):

       if mylist[i] - mylist[i-1] == 2:

           print(str(mylist[i])+" & "+str(mylist[i-1]),end=", ")

           count+=1

   print()

   print("There are "+str(count)+" twin primes")

Explanation:

See attachment for complete program where comments were used to explain each line

Download txt
7 0
2 years ago
Transparency is an important concept in policies related to the handling and use of customer data. Organizations should be trans
Tpy6a [65]

Answer: (C) Response controls

Explanation:

  According to the given question, the response control is not the necessary element while handling the users or customer data as compared to all the other given options that is individual participation, data minimization and the purpose specification.

  • The response control is basically used for exchange the data or any information in an organization but the main disadvantage is that they share all the response and information as they not wait for the request from the users.
  • The all the three other given options expect response control are the important element for handling the customer data as it helps in maintaining the Personal information.  

 Therefore, Option (C) is correct answer.  

6 0
3 years ago
Derive an expression for the boolean function L(a,c) whose output is 1 when the light would be on. Note that two of the switches
Naddik [55]

Answer:

Following are the solution to the given question:

Explanation:

Please find the graph image in the attachment file.

In the sequence, they recognize how modules are divided and elements were introduced in parallel. L(a,c) is thus going to also be

\to a*c + a'*c' = ac + a'c'

It allows, ideally, to bring a thumbs up.

3 0
2 years ago
Why does binary addition have a rule for 1 + 1 + 1 if only two numbers<br> are being added together?
dalvyx [7]

Answer:

See below

Explanation:

Because sometimes you have to 'carry' a 1 over to the ext column when adding two binary numbers

Example :

 1 1 1

<u>+1 1 1 </u>    <==== starting in the first R column add  1 + 1  to get 0 and carry 1

                then the next column you will add   1 + 1 + 1  = 1   and carry 1 again

                    then 1 + 1 + 1= 1  and carry 1 again (to column 4)  to get

1   1  1 0

5 0
2 years ago
A customer reports that recently several files cannot be accessed. The service technician decides to check the hard disk status
Lyrx [107]

Answer:

Back up the user data to removable disk

Explanation:

Before you work on a computer, especially anything that has to do with files not accessible, this might need to format the system because it might either be a virus or other forms of malware. Since backup was done to a different logical partition on the disk, the first thing to do before performing any diagnostic procedures on the disk is to back up the user data to a removable disk in order not to lose the information in the system.

8 0
3 years ago
Other questions:
  • With a(n) ____ data table you can vary the value in one cell.
    5·1 answer
  • In Python please:
    15·1 answer
  • ______________ is only one of the marketing mix tools that acompany uses to achieve its marketing objectives.
    7·1 answer
  • Which payment type is best if you are trying to stick to a budget?
    10·2 answers
  • Can change the tab colors of the worksheets in excel
    13·1 answer
  • Work-based learning can be defined as educational experiences that focus on
    6·1 answer
  • True or false, USBs are slower than RAM.
    15·1 answer
  • What could happen if I break copyright law in the future​
    14·2 answers
  • An epic games service is unavailable at the moment
    8·1 answer
  • even if we reach that state where an AI can behave as human does,how do we measure if AI is acting like a human?
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!