ode that will ask again what is asked if the input is wrong which has spaces

Microsoft Visual C#
7th Edition
ISBN:9781337102100
Author:Joyce, Farrell.
Publisher:Joyce, Farrell.
Chapter8: Advanced Method Concepts
Section: Chapter Questions
Problem 8RQ
icon
Related questions
Question

code that will ask again what is asked if the input is wrong which has spaces?

LO
11
12
13
14
15
16
L7
18
19
20
21
22
23
24
25
26
27
28
char SP;
do{
cout << "\nAre you Student or Professor [5 for Studen while P for Professor]: ";
cin >> SP;
SP-toupper (SP); //CAPS the inputed char
cin.ignore();
}while (SP != 'S' && SP != 'P');
if (SP == 'S'){
Stud();
}
else if (SP == *P'){
| Prof();
}
cout << endl;
32
33
ROBLEMS OUTPUT DEBUG CONSOLE TERMINAL
5 C:\Users\Joshua Kevin\Downloads> cd "c:\Users\Joshua Kevin\Downloads\"; if ($?) { g++ saasaasaas.cpp -o saasaasaas };
re you Student or Professor [S for Studen while P for Professor]: k
re you Student or Professor [S for Studen while P for Professor]: a
re you Student or Professor [S for Studen while P for Professor]: 5
re you Student or Professor [S for Studen while P for Professor]: %
re you Student or Professor [5 for Studen while P for Professor]: s p
ter First Name: Enter Last Name:
int main()
{
29
30
31
Transcribed Image Text:LO 11 12 13 14 15 16 L7 18 19 20 21 22 23 24 25 26 27 28 char SP; do{ cout << "\nAre you Student or Professor [5 for Studen while P for Professor]: "; cin >> SP; SP-toupper (SP); //CAPS the inputed char cin.ignore(); }while (SP != 'S' && SP != 'P'); if (SP == 'S'){ Stud(); } else if (SP == *P'){ | Prof(); } cout << endl; 32 33 ROBLEMS OUTPUT DEBUG CONSOLE TERMINAL 5 C:\Users\Joshua Kevin\Downloads> cd "c:\Users\Joshua Kevin\Downloads\"; if ($?) { g++ saasaasaas.cpp -o saasaasaas }; re you Student or Professor [S for Studen while P for Professor]: k re you Student or Professor [S for Studen while P for Professor]: a re you Student or Professor [S for Studen while P for Professor]: 5 re you Student or Professor [S for Studen while P for Professor]: % re you Student or Professor [5 for Studen while P for Professor]: s p ter First Name: Enter Last Name: int main() { 29 30 31
Expert Solution
steps

Step by step

Solved in 2 steps

Blurred answer
Knowledge Booster
Matrix multiplication
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
Recommended textbooks for you
Microsoft Visual C#
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning
Programming with Microsoft Visual Basic 2017
Programming with Microsoft Visual Basic 2017
Computer Science
ISBN:
9781337102124
Author:
Diane Zak
Publisher:
Cengage Learning
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781305480537
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
Programming Logic & Design Comprehensive
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage