CIS22A - Fall 2019 - Lab Exercise 4

due Wednesday, 10/16 8:30 am

Lab exercises are not accepted late.

Put your name, Lab Exercise 4, and compiler and the operating system used in a comment at the top of your program. Email only your source code. Your source code should be sent as an attachment (with the name ex4.cpp).  Use "Ex4" as the subject of your email submission

Program Requirements

Write a program, in which you prompt the user for an odd number.  If the user enters an odd number, print "Thank you very much".  If the user enters an even number, reprompt the user for an odd number.  If the user enters an odd number on the second try, print "Thanks".  If the user enters an even number on the second try, print a nasty message.  Test your program using the 3 cases below.

SAMPLE OUTPUT

Case #1

Enter an odd number => 3
Thank you very much

Case #2

Enter an odd number => 4
Enter an odd number => 5
Thanks

Case #3

Enter an odd number => 6
Enter an odd number => 8
You dummy!