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
Assume the secret key is: (1, 2, 3, 4) -&gt; (3, 1, 4, 2); assume the plaintext THEYLOVEIT. If the sub-block length is 3, what i
Alex777 [14]
I belive their were answer chocies to this question am i right 

8 0
3 years ago
How is abstraction used in a GPS system
ipn [44]
The designs on the map of the GPS system Im would think but can you be more specific?
8 0
3 years ago
Read 2 more answers
Assume that name has been declared suitably for storing names (like "Amy", "Fritz" and "Moustafa"). Assume also that stdin is a
aniked [119]

Answer:

void main(){

string name;

printf("Enter Name\n");

stdin("%s",&name);

Printf("\nGreetings %s",name);

}

Explanation:

Here scanf is represented by stdin and we are using that scanner object to read the string value from user.The value which we read are printed in a new line using printf .The format specifier %s in printf is replaced by name variable

3 0
3 years ago
Write code statements that prompt for and read a double value from the user, and then print the result of raising that value to
andriy [413]

Answer:

Following are the code in Java Language:

Scanner sc = new Scanner(System.in); // create a instance of scanner class

DecimalFormat frmt = new DecimalFormat("0.###"); // create a instance of                // DecimalFormat class

System.out.println ("Enter the value: ");

double number = scan.nextDouble(); // Read the value by thje user

System.out.println (fmmt.format(Math.pow(number, 4))); // display the value

Explanation:

Following are the description of the code

  • Create an instance scanner class i.e "sc".
  • Create an instance of DecimalFormat class i.e "frmt".
  • Read the value by the user in the "number" variable of type double by using the nextDouble()method.
  • Finally, display the value by using System.out.println method. In this, we call the method format. The Math.pow() function is used to calculating the power up to the fourth value.

5 0
3 years ago
A Boolean operator acts on two inputs, A and B. The output is 1 only if one input is the opposite of the other. What truth table
Verdich [7]

Answer:

In this situation OR operator are used

In this operator if one input is one then the out put will be one or if one condition is true and one is false the result is true.The out put is always one in this truth table except input output both are zero

Truth  table of OR  

A          B        C

0          0         0

0          1           1

1           0          1

1            1          1

5 0
3 years ago
Other questions:
  • Where are Micro USB connectors used the most?
    11·2 answers
  • Molly, a technician, has been tasked with researching an emulator for the software developers to test cross-platform application
    7·1 answer
  • Although highly accurate navigational information from the GPS constellation is exploitable by adversary forces, it is unlikely
    5·1 answer
  • You have a 20-bit network part and a 4-bit subnet part. How many hosts can you have per subnet?
    15·1 answer
  • If you wish to maintain a consistent style to all the documents you create, it would be helpful to use a _​
    5·1 answer
  • Which magazine introduced the first microcomputer kit for the mits altair in its january 1975 issue?
    8·1 answer
  • Given a PrintWriter reference variable named output that references a PrintWriter object, write a statement that writes the stri
    5·1 answer
  • Give four advantages for ssd compared to hdd
    15·2 answers
  • What are the three general methods for delivering content from a server to a client across a network
    8·1 answer
  • Write the importance of program in computer​
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!