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
On a client/server network, data does not necessarily follow the same path between the request (client) and the response (server
Andrej [43]

Answer:

SSL and HTTPS play a factor

6 0
2 years ago
1. what is the purpose of giving an id to an html element when using javascript?
bazaltina [42]

Answer:

It is also used by JavaScript to access and manipulate the element with the specific id.

3 0
2 years ago
To secure the company website, the webmaster suggests that the company purchase a secure certificate to encrypt all communicatio
iVinArrow [24]

Answer: Software

Explanation:

Security certificate is defined as the assurance that maintain authenticity and intactness of a website or different sites.It is present in small sized data filed that establishes encryption and validation through verification of owner's identity.

  • As per the suggestion of Webmaster, who takes care of web-pages and web-servers , security certificate should be purchased to verify the transmission of message with encryption.
  • Certificate in this case will be acting as software for providing security and operations to the websites.

4 0
3 years ago
Whose task it is to ensure that the product flows logically from one step to another?
vlabodo [156]

Answer:

The broad responsibility of a UX designer is to ensure that the product logically flows from one step to the next. One way that a UX designer might do this is by conducting in-person user tests to observe one’s behavior.

Explanation: I don't know if this is what your looking for though.

3 0
3 years ago
a cryptarithm is a mathematical puzzle where the goal is to find the correspondence between letters and digits such that the giv
Leokris [45]

Using the knowledge in computational language in C++ it is possible to write a code that  cryptarithm is a mathematical puzzle where the goal is to find the correspondence between letters and digits

<h3>Writting the code:</h3>

<em>#include <bits/stdc++.h></em>

<em>using namespace std;</em>

<em>// chracter to digit mapping, and the inverse</em>

<em>// (if you want better performance: use array instead of unordered_map)</em>

<em>unordered_map<char, int> c2i;</em>

<em>unordered_map<int, char> i2c;</em>

<em>int ans = 0;</em>

<em>// limit: length of result</em>

<em>int limit = 0;</em>

<em>// digit: index of digit in a word, widx: index of a word in word list, sum: summation of all word[digit]  </em>

<em>bool helper(vector<string>& words, string& result, int digit, int widx, int sum) { </em>

<em>    if (digit == limit) {</em>

<em>        ans += (sum == 0);</em>

<em>        return sum == 0;</em>

<em>    }</em>

<em>    // if summation at digit position complete, validate it with result[digit].</em>

<em>    if (widx == words.size()) {</em>

<em>        if (c2i.count(result[digit]) == 0 && i2c.count(sum%10) == 0) {</em>

<em>            if (sum%10 == 0 && digit+1 == limit) // Avoid leading zero in result</em>

<em>                return false;</em>

<em>            c2i[result[digit]] = sum % 10;</em>

<em>            i2c[sum%10] = result[digit];</em>

<em>            bool tmp = helper(words, result, digit+1, 0, sum/10);</em>

<em>            c2i.erase(result[digit]);</em>

<em>            i2c.erase(sum%10);</em>

<em>            ans += tmp;</em>

<em>            return tmp;</em>

<em>        } else if (c2i.count(result[digit]) && c2i[result[digit]] == sum % 10){</em>

<em>            if (digit + 1 == limit && 0 == c2i[result[digit]]) {</em>

<em>                return false;</em>

<em>            }</em>

<em>            return helper(words, result, digit+1, 0, sum/10);</em>

<em>        } else {</em>

<em>            return false;</em>

<em>        }</em>

<em>    }</em>

<em>    // if word[widx] length less than digit, ignore and go to next word</em>

<em>    if (digit >= words[widx].length()) {</em>

<em>        return helper(words, result, digit, widx+1, sum);</em>

<em>    }</em>

<em>    // if word[widx][digit] already mapped to a value</em>

<em>    if (c2i.count(words[widx][digit])) {</em>

<em>        if (digit+1 == words[widx].length() && words[widx].length() > 1 && c2i[words[widx][digit]] == 0) </em>

<em>            return false;</em>

<em>        return helper(words, result, digit, widx+1, sum+c2i[words[widx][digit]]);</em>

<em>    }</em>

<em>    // if word[widx][digit] not mapped to a value yet</em>

<em>    for (int i = 0; i < 10; i++) {</em>

<em>        if (digit+1 == words[widx].length() && i == 0 && words[widx].length() > 1) continue;</em>

<em>        if (i2c.count(i)) continue;</em>

<em>        c2i[words[widx][digit]] = i;</em>

<em>        i2c[i] = words[widx][digit];</em>

<em>        bool tmp = helper(words, result, digit, widx+1, sum+i);</em>

<em>        c2i.erase(words[widx][digit]);</em>

<em>        i2c.erase(i);</em>

<em>    }</em>

<em>    return false;</em>

<em>}</em>

<em>void isSolvable(vector<string>& words, string result) {</em>

<em>    limit = result.length();</em>

<em>    for (auto &w: words) </em>

<em>        if (w.length() > limit) </em>

<em>            return;</em>

<em>    for (auto&w:words) </em>

<em>        reverse(w.begin(), w.end());</em>

<em>    reverse(result.begin(), result.end());</em>

<em>    int aa = helper(words, result, 0, 0, 0);</em>

<em>}</em>

<em />

<em>int main()</em>

<em>{</em>

<em>    ans = 0;</em>

<em>    vector<string> words={"GREEN" , "BLUE"} ;</em>

<em>    string result = "BLACK";</em>

<em>    isSolvable(words, result);</em>

<em>    cout << ans << "\n";</em>

<em>    return 0;</em>

<em>}</em>

See more about C++ code at brainly.com/question/19705654

#SPJ1

3 0
1 year ago
Other questions:
  • Which of the following is not true about designing classes? In order for class information to be printed instead of a memory add
    12·1 answer
  • What is Mainframe computer​
    15·1 answer
  • After a suspected identity fraud case has been resolved, you should:
    5·1 answer
  • you have a small network in your business with just a few network devices connected along with 22 linux computers and you want t
    7·1 answer
  • In our discussion of Computer Hardware, we talked about three essential hardware components that are there inside every computer
    14·1 answer
  • What is the data type of the following expression?
    12·2 answers
  • Prompts what is a row?
    7·1 answer
  • State any three points of importance of local level profession​
    11·1 answer
  • A computer is defined by 4 specific criteri. Select all 4.*
    10·1 answer
  • I have all of the points and brainliest, but it won't level up, I don't know why, anyone know why?
    12·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!