If-else statement and loop | Computer Science homework help

4 parts of the assignment:

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 heshe 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 heshe gets the right one, next week!).

Part 3: Modify the question above so that you keep on asking the user for names till heshe gets it right! So heshe 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.

Calculate your order
Pages (275 words)
Standard price: $0.00
Client Reviews
Our Guarantees
100% Confidentiality
Information about customers is confidential and never disclosed to third parties.
Original Writing
We complete all papers from scratch. You can get a plagiarism report.
Timely Delivery
No missed deadlines – 97% of assignments are completed in time.
Money Back
If you're confident that a writer didn't follow your order details, ask for a refund.

Calculate the price of your order

You will get a personal manager and a discount.
We'll send you the first draft for approval by at
Total price:
Power up Your Academic Success with the
Team of Professionals. We’ve Got Your Back.
Power up Your Study Success with Experts We’ve Got Your Back.