Write a program that stores your name in a variable


Problem: If-Else Statement and Loop

• 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.

• 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!).

• 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.

• 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.

The response must include a reference list. Using one-inch margins, double-space, Times New Roman 12 pnt font and APA style of writing and citations.

Request for Solution File

Ask an Expert for Answer!!
Computer Engineering: Write a program that stores your name in a variable
Reference No:- TGS03116369

Expected delivery within 24 Hours