Write a function (seat_type) that reads an input from the user that represents a seat class. The user should enter F: for a first class seat, C: for a business class seat, or Y: for an economy seat. The function should validate the user input to accept only F, C, or Y.
yassink
0
Newbie Poster
Recommended Answers
Jump to PostWhat do you have so far?
Jump to PostSchool problem. Not allowed according to site's TOS. If you make an honest effort to solve this yourself, we can help you, but DO NOT ask us to do your work for you! :-(
Jump to PostCome on! That's so easy. If you would have peeked in any of the c++/c books or online tutorials, you woud have found an revealing example.
Use google, try with c++ tutorial. I'm sure you'll find the answer there.
Jump to Post
while ( (z != "F") || (z != "C") || (z != "Y") )
Can you give me a value of z for which this will not be true? Any value at all - give me one letter that will make the while loop stop.
All 14 Replies
pritaeas
2,179
¯\_(ツ)_/¯
Moderator
Featured Poster
rubberman
1,355
Nearly a Posting Virtuoso
Featured Poster
aradicev
0
Newbie Poster
yassink
0
Newbie Poster
Moschops
683
Practically a Master Poster
Featured Poster
yassink
0
Newbie Poster
Moschops
683
Practically a Master Poster
Featured Poster
yassink
0
Newbie Poster
Moschops
683
Practically a Master Poster
Featured Poster
yassink
0
Newbie Poster
yassink
0
Newbie Poster
k99rs
9
Newbie Poster
mridul.ahuja
4
Coding Enthusiast
RonalBertogi
46
Junior Poster in Training
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.