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
makvit [3.9K]
3 years ago
12

Write a program that use a switch statement whose controlling expression is the variable area code. If the value of area_code is

in the table, the switch statement will print the corresponding city's name to the screen. Otherwise, the switch statement will print the message "Area code not found." to the screen. Use case "fall throughs" in order to simplify the switch block as much as possible.

Computers and Technology
1 answer:
scZoUnD [109]3 years ago
6 0

Answer:

Table for Area codes are not missing;

See Attachment for area codes and major city I used

This program will be implemented using c++ programming language.

// Comments are used for explanatory purposes

// Program starts here

#include <iostream>

using namespace std;

int main( )

{

// Declare Variable area_code

int area_code;

// Prompt response from user

cout<<Enter your area code: ";

cin<<"area_code;

// Start switch statement

switch (area_code) {

// Major city Albany has 1 area code: 229...

case 229:

cout<<"Albany\n";

break;

// Major city Atlanta has 4 area codes: 404, 470 678 and 770

case 404:

case 470:

case 678:

case 770:

cout<<"Atlanta\n";

break;

//Major city Columbus has 2 area code:706 and 762...

case 706:

case 762:

cout<<"Columbus\n";

break;

//Major city Macon has 1 area code: 478...

case 478:

cout<<"Macon\n";

break;

//Major city Savannah has 1 area code: 912..

case 912:

cout<<"Savannah\n";

break;

default:

cout<<"Area code not recognized\n";

}

return 0;

}

// End of Program

The syntax used for the above program is; om

You might be interested in
11. Describe an algorithm that interchanges the values of the variables x and y, using only assignments. What is the minimum num
Svetlanka [38]

Answer:

Following is the algorithm to interchange the value of two variable x and y.

step 1:Read the two integer x and y.

step 2 :t=x

Step 3: x=y  

step 4: y=t

The minimum number of assignment to do this is 3

Explanation:

After reading two integer x & y, create a variable "t" of integer type.

with the help of variable "t", we can swap the value of variable x and y.

It requires 3 assignment to interchange the value.

6 0
3 years ago
Combination of one or more columns used to identify particular rows in a relation is a (n)<br>​
Licemer1 [7]

Answer:

Combination of one or more columns used to identify particular rows in a relation is a key

5 0
2 years ago
Use the ________ method to write text to a web page.
Nastasia [14]
Document.write()

I'm not sure that this is a method, but I think this is right. 
3 0
3 years ago
You plug a new scanner into a USB port on your Windows system. When you first turn on the scanner, what should you expect to see
Paul [167]

Answer:

A window notifying that: Found New Hardware Wizard

Explanation:

As soon as any device is plugged into the USB port, the default settings will display a window onto the screen which will notify about the addition of a new hardware to the system. This window can further be used to know the properties of the hardware or for configuration settings.

This process is same like the software part, that whenever a new application is installed onto the system a pop up notification alerts about its presence.

So when the scanner will be attached through USB port a window will be appeared notifying about the discovery of new hardware.

3 0
3 years ago
Design (draw a datapath) for a block that will help your processor decide whether to take a branch for different conditions. As
LekaFEV [45]

Answer:

See explaination

Explanation:

Here are the steps taken to draw the diagram!

opcode0 and the opcode1 signals are inverted/not to determine the case whether it is 00, 01, 10, 11.

Then they are 'and'ed with the corresponding Zero/lt signal to confirm if the case is true, for eg. zero = 1 if opcode = 00 (beq).

Then all the cases are 'or'ed to get the Branch signal!

See attachment for the diagram

8 0
3 years ago
Other questions:
  • In this code, identify the repeated pattern and replace it with a function called month_days, that receives the name of the mont
    14·1 answer
  • An attribute whose value uniquely identifies an object is called a(n) _______.​
    15·1 answer
  • If you are trying to create a web page for your band and having difficulty creating links to other groups on your page, what is
    7·1 answer
  • An app builder has created a report for sales people to view records from the custom object, some users have complained that the
    8·1 answer
  • A provides an easy way for workers to interact with their computers
    9·1 answer
  • What Is entered into the system as input?
    13·1 answer
  • List three types of Software:
    15·1 answer
  • What happens when the electrons flowing through the light bulb change direction?
    11·1 answer
  • True or False: At the Company level, users will only have access to view projects to which they have been specifically granted a
    5·2 answers
  • What are the advantages of cloud computing over computing on premises?
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!