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
Do rats smell good? what do you think
irina1246 [14]

Answer:

Rats are not smelly animals. They are actually extremely clean animals and should not smell bad at all. ... A sick rat odor will smell like infection. Most likely if you are smelling your rats it is due to the cage and bedding not being cleaned often enough or from using the wrong type of litter and bedding.

Explanation:

7 0
4 years ago
Read 2 more answers
A(n) ____ is a list of authorization rights attached to an object - in other words, who can access that device or application an
xz_007 [3.2K]

Answer:

access control list (ACL)

Explanation:

An access control list (ACL) is a list of authorization rights attached to an object - in other words, who can access that device or application and what can they do with it.

An access control can be defined as a security technique use for determining whether an individual has the minimum requirements or credentials to access or view resources on a computer by ensuring that they are who they claim to be.

Simply stated, access control is the process of verifying the identity of an individual or electronic device. Authentication work based on the principle (framework) of matching an incoming request from a user or electronic device to a set of uniquely defined credentials.

Basically, authentication and authorization is used in access control, to ensure a user is truly who he or she claims to be, as well as confirm that an electronic device is valid through the process of verification

Hence, an access control list primarily is composed of a set of permissions and operations associated with a file.

3 0
3 years ago
Question B_1 (15 points) Please define (describe) local variables and how they are used in computer programming ( e.g. In C, C )
OverLord2011 [107]

Answer and Explanation:

Static variables are variables that still maintain their values outside the score which they are declared. They are declared with the static keyword

Example:

<em>static int score = 30;</em>

Local variables are variables whose scope are restricted to a block. Their values are restricted to the block which they are declared in.

Example:

<em>void abd(){</em>

<em>int score;</em>

<em>}</em>

<em>score is a local variable to abcd() function</em>

5 0
3 years ago
What's it called when a program is expandable?
sashaice [31]
Its called a genesis program
6 0
3 years ago
A university with remote campuses, which all use different service providers, loses Internet connectivity across all locations.
Anastaziya [24]

Answer:

A & D.

Explanation:

In real time operating system, the best description for this type of attack explained in the question is;

DOS and Race Condition.

Because race condition takes place when 2 or more threads are able to both access and change shared data simultaneously ,while DOS is a good foundation to build a custom made Real time operating system.

Thus, options A & D are correct.

5 0
3 years ago
Other questions:
  • Which of the following has the responsibility of offering instruction on intrusion detection systems and intrusion prevention sy
    11·1 answer
  • Assume each student is assigned an advisor from a department. Each classroom is assigned a classroom (class# determines Classroo
    14·1 answer
  • How do you add a section break that would start the new section on the same page?
    12·2 answers
  • Suppose you have two tables: officer and gentleman. what question(s) can be asked by using the union operator?
    11·1 answer
  • A(n) _____ can replace many applications with one unified set of programs, making the system easier to use and more effective.
    8·1 answer
  • Write a loop that displays all possible combinations of two letters where the letters are 'a', or 'b', or 'c', or 'd', or 'e'. T
    10·1 answer
  • What should you do before using a website to store student information ? A. Read and understand the website’s privacy contract
    11·2 answers
  • PLEASE HELP ASAP
    15·1 answer
  • We cannot imagine a life without the Internet. Imagine that you had to live without being connected to the Internet. Discuss the
    13·1 answer
  • Network administrators use _____ technology when they need antivirus updates to be automatically downloaded on employees' workst
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!