C++ for Engineers and Scientists
C++ for Engineers and Scientists
4th Edition
ISBN: 9781133187844
Author: Bronson, Gary J.
Publisher: Course Technology Ptr
Bartleby Related Questions Icon

Related questions

bartleby

Concept explainers

Question
100%

c not c++

Procedure 3. Write a program with the switch statement.
Use function getchar() to ask the user to enter a character and assign it to a variable
number1. Check to see if the character is 'r', 'R’, 'n’, 'N’, 'z'. or Z.
• If it is 'n' or 'N':
1. Ask the user to input an integer number and assign it to a variable called number1.
2. Print out your name on the screen.
• If it is 'r' or 'R': ask the user to input two float number and then:
1. Print the square root of each number (please use sqrt function in the math.h library).
2. Print the sum of the squared root numbers.
• If it is 'z' or 'Z':
1. ask the user to input a character with getchar() function.
2. Print the ASCII code of the character on the screen.
• If the input is none of these options, print the message "Goodbye".
expand button
Transcribed Image Text:Procedure 3. Write a program with the switch statement. Use function getchar() to ask the user to enter a character and assign it to a variable number1. Check to see if the character is 'r', 'R’, 'n’, 'N’, 'z'. or Z. • If it is 'n' or 'N': 1. Ask the user to input an integer number and assign it to a variable called number1. 2. Print out your name on the screen. • If it is 'r' or 'R': ask the user to input two float number and then: 1. Print the square root of each number (please use sqrt function in the math.h library). 2. Print the sum of the squared root numbers. • If it is 'z' or 'Z': 1. ask the user to input a character with getchar() function. 2. Print the ASCII code of the character on the screen. • If the input is none of these options, print the message "Goodbye".
Expert Solution
Check Mark
Knowledge Booster
Background pattern image
Computer Science
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
SEE MORE QUESTIONS
Recommended textbooks for you
Text book image
C++ for Engineers and Scientists
Computer Science
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Course Technology Ptr
Text book image
C++ Programming: From Problem Analysis to Program...
Computer Science
ISBN:9781337102087
Author:D. S. Malik
Publisher:Cengage Learning
Text book image
Programming with Microsoft Visual Basic 2017
Computer Science
ISBN:9781337102124
Author:Diane Zak
Publisher:Cengage Learning
Text book image
Microsoft Visual C#
Computer Science
ISBN:9781337102100
Author:Joyce, Farrell.
Publisher:Cengage Learning,
Text book image
COMPREHENSIVE MICROSOFT OFFICE 365 EXCE
Computer Science
ISBN:9780357392676
Author:FREUND, Steven
Publisher:CENGAGE L
Text book image
EBK JAVA PROGRAMMING
Computer Science
ISBN:9781337671385
Author:FARRELL
Publisher:CENGAGE LEARNING - CONSIGNMENT