Part 1: Check out the lecture notes and read chapter 6 of the text book before attempting these problems (see attachment)
1) Write a program that prompts the user for a number, tests to see whether that number is even or odd and prints out “Number is Even” if it is even, or “Number is Odd” if it is odd.
Hint: An even number is one that is dividable by 2 and has no remainder! Look up the % operator.
Part 2: 2) Write a program that stores your name in a variable. Then ask the user to guess your name. If he\she guesses right, display the message “Well done, good guess work!”, otherwise display the message “Try again next time!” and just exit the program at that point (we’ll see how to loop, i.e. keep on asking the user for names till he\she gets the right one, next week!).
Part 3: Modify the question above so that you keep on asking the user for names till he\she gets it right! So he\she has to guess your name right BEFORE you exit the program. Use a while loop.
Part 4:Write a program that asks the user for 5 numbers, using a for loop and one input function call inside that for loop. Sum the numbers as you are getting them from the user, then display the sum and average to the user at the end.
Try it now!
How it works?
Follow these simple steps to get your paper done
Place your order
Fill in the order form and provide all details of your assignment.
Proceed with the payment
Choose the payment system that suits you most.
Receive the final file
Once your paper is ready, we will email it to you.
No need to work on your paper at night. Sleep tight, we will cover your back. We offer all kinds of writing services.
No matter what kind of academic paper you need and how urgent you need it, you are welcome to choose your academic level and the type of your paper at an affordable price. We take care of all your paper needs and give a 24/7 customer care support system.
Admission Essays & Business Writing Help
An admission essay is an essay or other written statement by a candidate, often a potential student enrolling in a college, university, or graduate school. You can be rest assurred that through our service we will write the best admission essay for you.
Our academic writers and editors make the necessary changes to your paper so that it is polished. We also format your document by correctly quoting the sources and creating reference lists in the formats APA, Harvard, MLA, Chicago / Turabian.
If you think your paper could be improved, you can request a review. In this case, your paper will be checked by the writer or assigned to an editor. You can use this option as many times as you see fit. This is free because we want you to be completely satisfied with the service offered.