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
TiliK225 [7]
3 years ago
3

Write a switch statement that tests the value of the char variable response and performs the following actions: if response is y

, the message Your request is being processed is printed if response is n, the message Thank you anyway for your consideration is printed if response is h, the message Sorry, no help is currently available is printed for any other value of response, the message Invalid entry; please try again is printed
Computers and Technology
1 answer:
VLD [36.1K]3 years ago
7 0

Answer:

Following is the C++ code using switch statement.

#include <iostream>

using namespace std;

int main() {

char response;//response variable of type char..

cout<<"Enter the response"<<endl;

cin>>response;//taking input...

switch(response)

{

   case 'y':

cout<<"Request is being processed"<<endl;//printing for response y

   break;

   case 'n':

cout<<"Thank you anyway for your consideration"<<endl;//printing for response n

   break;

   case 'h':

cout<<"Sorry no help is currently available"<<endl;;//printing for response h

   break;

   default:

cout<<"Invalid entry; please try again"<<endl;//printing for other response

}

return 0;

}

Output:

Enter the response

y

Your request is being processed

Enter the response

o

Invalid entry; please try again

Explanation:

I have taken a char variable response and have taken input form the user.Then switch cases are used according to the question.

You might be interested in
As Alexa types a message, Outlook autosaves the message at various points. In which folder is the message located if Alexa wants
alexgriva [62]

Answer:

Draft

Explanation:

Draft is a specific folder in email that is meant to store partially finished mails and mails which has been created but is not sent .  Draft folders helps in reducing rework on the mail if one is interrupted while writing the mail. Another purpose of draft folder was that if anyone accidentally closes the  mail writing section then the content of mail is not lost and can be easily be obtained in draft folder. It also helps in tracking unsent and unfinished mail for the user.

Since, message written by Alexa is saved at different points but is not sent then if the mail is to be sent, then one needs to look for that mail in Draft folder.

5 0
3 years ago
Read 2 more answers
a) Write a program that prompts for an integer—let’s call it X—and then finds the sum of X consecutive integers starting at 1. T
Alex73 [517]

Answer:

<u>Solution a</u>

  1. n = int(input("Enter an integer: "))
  2. sum = 0
  3. for x in range(1, n+1):
  4.    sum += x  
  5. print(sum)

<u>Solution b</u>

  1. n = int(input("Enter an integer: "))
  2. for a in range(1, n + 1):
  3.    sum = 0
  4.    for x in range(1, a+1):
  5.        sum += x
  6.    print(sum)

Explanation:

Solution code is written in Python 3.

<u>Solution a</u>

First get the user input for an integer (Line 1).

Create a variable sum and initialize it with zero value (Line 3).

Create a for loop to traverse through the number from 1 to integer n (inclusive) and sum up the current number x (Line 5-6).

Print the sum to terminal (Line 8).

<u>Solution b</u>

Create an outer for loop that traverse through the number from 1 to integer n (inclusive) (Line 3).

Create an inner loop that traverse through the number from 1 to current a value from the outer loop and sum up the current x value (Line 5-6).

Print the sum to terminal (Line 7) and proceed to next iteration and reset the sum to zero (Line 4).

7 0
3 years ago
What's the main idea??
tatyana61 [14]
My computer wont let me download this pdf

7 0
3 years ago
If you want to copy text formatting from one area of your document to another area, _____. a. select the formatting you would li
Travka [436]

Answer:

I believe it is ‘A’

Explanation:

The Format Painter feature copies only the formatting from one selected text to another. The content and text of the selection will not be copied using Format Painter.

6 0
4 years ago
What is technology?
Anestetic [448]
D. the application of scientific discoveries 
5 0
3 years ago
Other questions:
  • Your organization issues devices to employees. These devices generate one-time passwords every 60 seconds. A server hosted withi
    15·1 answer
  • To provide both encryption and integrity protection, wpa2 uses aes encryption with:
    12·1 answer
  • Can someone buy me eddie van der tabs???
    13·1 answer
  • Discuss the importance of top management commitment and the development of standards for successful project management. Provide
    10·1 answer
  • You've run 200 ft of cable and lost 7dB. What is the loss rate of your cable per 100 ft?
    14·1 answer
  • A bear is an animal and a zoo contains many animals, including bears. Three classes Animal, Bear, and Zoo are declared to repres
    12·1 answer
  • 1. What was the very first “photo-realistic CGI character” to appear on-screen in a movie (released in 1985)?
    8·2 answers
  • Imagine you’re at lunch. Your nose smells pizza. Your legs move over to where hot lunch is being served. You have to balance the
    9·2 answers
  • WRITE A PROGRAM TO CALCULATE SIMPLE INTEREST
    12·1 answer
  • Tristan just downloaded a new game he wants to play on his computer. What kind of file should he open in order to install and ru
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!