Question
Many user-created passwords are simple and easy to guess. Write a program that prompts the user to enter a password and makes it stronger by
Many user-created passwords are simple and easy to guess. Write a program that prompts the user to enter a password and makes it stronger by replacing characters using the key below, and by appending "!" to the end of the input string. Also, the character spaces is NOT allowed to be used for the password.
- i becomes 1
- a becomes @
- m becomes M
- B becomes 8
- s becomes $
- e becomes 3
Ex: If the input is: mepassword
the output is: M3p@$$word!
Your project should only contain one java file, once you are done answering the question and running it, post the results in the java file as comments and upload the java file
2.
Adam and Oliver saw 21 Easter eggs in the yard. Both of them wanted all of the eggs for themselves, so they decided to play a game...the winner will take them all. They would alternate turns and in each turn 1 to 5 eggs would be taken. No more than 5 eggs can be selected at a time. They agreed that whichever one took the last egg would be able to keep all of the 21 eggs and thus be the "winner." Adam is always allowed to choose first. Your program has to prevent either player from taking more than 5 eggs or even the illogical move of taking more eggs than are remaining.
-----------------------------------------------------------------------------------------------------------
First Set of Data: The turns were as follows:
Total Eggs: 21
Adam turn: 2
Eggs left: 19
Oliver turn: 3
Eggs left: 16
Adam turn: 4
Eggs left: 12
Oliver turn: 5
Eggs left: 7
Adam turn: 3
Eggs left: 4
Oliver turn: 3
Eggs left: 1
Adam turn: 1
Eggs left: 0
Winner is : Adam
------------------------------------------------------------------------------------------------------
Second Set of Data: The turns were as follows:
Total Eggs: 21
Adam turn: 4
Eggs left: 17
Oliver turn: 3
Eggs left: 14
Adam turn: 7 ERROR MESSAGE
Adam turn: 4
Eggs left: 10
Oliver turn: 3
Eggs left: 7
Adam turn: 4
Eggs left: 3
Oliver turn: 4 ERROR MESSAGE
Oliver turn: 3
Eggs left: 0
Winner is : Oliver
-----------------------------------------------------------------------------------------------------------
Your project should only contain one java file, once you are done answering the question and running it, post the results in the java file as comments and upload the java file
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started