Write a program that keeps asking the user for a password


Lab Assignment- Iterations

1. Write a program that keeps asking the user for a password until they correctly name it. Once they correctly enter the password, the program congratulates the user and tells them how many guesses it took. Call the program lastnamePassword.

Example (user input in italics)

What is the password?
monkeys
Incorrect. Guess again.
dishwasher
Incorrect. Guess again.
aardvark
Correct! You got the password, and it took you 3 guesses to get it correct.

2. Write a program that takes a string input from the user and then outputs the word, then the word minus the last letter, then the word minus the second to last letter, etc until it only prints the first letter. Name the program lastNameDown. ?

Extra: After going down to one letter, print the opposite back up to the full word - if you do this name your program lastNameDownUp.

Input: Computer
Output:
Computer
Compute
Comput
Compu
Comp
Com
Co
C

3. Write a program that asks the user for an integer input, and prints out all of the Fibbonacci numbers below that input. Each number in the Fibbonacci sequence is found by adding the two previous ( 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, etc) Name the Program lastNameFibb.

Enter an integer: 20

1
1
2
3
5
8
13

That is all of the Fibbonacci numbers below 20.

Request for Solution File

Ask an Expert for Answer!!
Computer Engineering: Write a program that keeps asking the user for a password
Reference No:- TGS02703591

Expected delivery within 24 Hours