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
fenix001 [56]
3 years ago
10

C++: The program Telephone Digits outputs only telephone digits that correspond to uppercase letters. Rewrite the program so tha

t it processes both uppercase and lowercase letters and outputs the corresponding telephone digit. If the input is something other than an uppercase or lowercase letter, the program must output an appropriate error message.
Computers and Technology
1 answer:
maks197457 [2]3 years ago
6 0

Answer:

Following are the program written in the C++ Programming Language:

#include <iostream>  //header file

using namespace std;  //using namespace

int main()  //main function

{

   char letters;

   cout << "To stop the program enter 0" << endl;

   cout << "Enter letter: " ;

   cin >> letters;

   //set while loop

   while (letters != '0' && letters >= 'A' && letters <= 'z') {

       cout << "The letter you entered: " << letters << endl;

       cout << "corresponding telephone digits is: ";

       if (letters > 'Z') {   //if statement

           letters = (int)letters-32; // letters covertion

       }

       switch (letters) { //switch statement

           case'A':

           case'B':

           case'C':

               cout << "2" << "\n""\n"; //print message

               break;  //break the statement

           case'D':

           case'E':

           case'F':

               cout << "3" << "\n""\n";  //print message

               break;  //break the statement

           case'G':

           case'H':

           case'I':

               cout << "4" << "\n""\n";   //print message

               break;  //break the statement

           case'J':

           case'K':

           case'L':

               cout << "5" <<"\n""\n";  //print message

               break; //break the statement

           case'M':

           case'N':

           case'O':

               cout << "6" <<"\n""\n";  //print message

               break; //break the statement

           case'P':

           case'Q':

           case'R':

           case'S':

               cout << "7" << "\n""\n";   //print message

               break;   //break the statement

           case'T':

           case'U':

           case'V':

               cout << "8" << "\n""\n";   //print message

               break;  //break the statement

           case'W':

           case'X':

           case'Y':

           case'Z':

               cout << "9" << "\n""\n";  //print message

               break; //break the statement

           default:

               break; //break the statement

       }

       //print and return letters

       cout << "Enter another letter to find out the number: ";

       cin >> letters;

   }

 return 0;

}

<u>Output</u>:

To stop the program enter 0

Enter letter: a

The letter you entered: a

corresponding telephone digits is: 2

Enter another letter to find out the number: S

The letter you entered: S

corresponding telephone digits is: 7

Enter another letter to find out the number: 0

Explanation:

Here, we define header file "<iostream>" and namespace "std" then, we define main() function.

  • Then, inside the main function we set character data type variable "letters" and then print message and get input from the user in the variable "letters".
  • Then, we set the while loop and pass the condition then, we set the if statement and print two message.
  • Then, we set the switch statement inside the while loop and pass the letter variable in it's parameter then, we set the following cases of the switch statement.
  • Finally, we print the message and print the value of the variable "letters" then, return 0 and close the main() function.
You might be interested in
RTOS stands for ______ Time Operating System.
ch4aika [34]

Answer:

Real Time Operation System

Explanation:

6 0
3 years ago
PLEASE help me RIGHT NOW!!!!!!!!! I will give a Brainly to anyone who helps me!
dybincka [34]
I am deeply sorry for the experience that you have received, I am disappointed in myself for letting this happen. If it would be possible I would like to make it up to you. Again, I am deeply sorry that this happened. 
Sincerely *enter full name*

I am not sure if you have any multiple choice options but I hope this works xx
8 0
3 years ago
Greg wants to check the amount of requests his website receives. What test can he use?
Alenkinab [10]

Answer:

D - Website load test

Explanation:

Just got it right

4 0
3 years ago
The _______ is a connection of computers and networks built into common, everyday devices.
crimeas [40]

Answer:

B. Internet of things.

Explanation:

Internet of things (IOT) is an interconnection of everyday devices through the internet to allow the device send and receive data. It is used for remote connections in offices, homes and industries to achieve various activities like switching of the power status, regulating device operation etc, in the absence of a physical operator.

BYOD or bring your device to work is a situation where members of an organisation connect and use their personal devices in the company's private network.

7 0
4 years ago
Describe the different non-printing characters,​
irakobra [83]

Answer:

or formatting marks are characters for content designing in word processors, which aren't displayed at printing. It is also possible to customize their display on the monitor. The most common non-printable characters in word processors are pilcrow, space, non-breaking space, tab character etc.

Explanation:

5 0
3 years ago
Other questions:
  • Given a floating point variable fraction, write a statement that displays the value of fraction on the screen. Do not display an
    13·1 answer
  • Because it is important not to disrupt the normal business function, joint application design (JAD) sessions should be held at a
    11·1 answer
  • Which of the following is typically not found in web page-authoring software
    9·1 answer
  • A web ______ is a computer that delivers requested webpages to your computer or mobile device.
    7·1 answer
  • what are examples of conditional formatting tools? check all that apply. color scales, icon sets,data bars,cell styles,themes
    8·1 answer
  • Write a program that will read the payroll file. It should output the name and paycheck amount. Also output the total pay of all
    13·1 answer
  • Which data type is –7?<br><br> int<br><br> single<br><br> string<br><br> float
    15·1 answer
  • In a typical day, what types of Computer-Mediated Communication do you use?
    8·1 answer
  • Is a mainframe computer portable?​
    10·1 answer
  • You need to design an online login form in which users have to type their name and password to log into an application. The pass
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!