Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Write a program that determines if the user cracked the code. The program should do the following steps ( check hackerrank for exact wording )
Write a program that determines if the user cracked the code. The program should do the following steps check hackerrank for exact wording:
Ask the user for their name and greet them.
Ask the user if they would like to crack the code. If the user enters no in any case the program should exit. Use return; to make the code end. If the user enters yes in any case the program should proceed to the next step. If the user enters anything else, the program should print an error message that the response is not supported and exit.
Ask the user to guess the code. The code consists of a number, then a String, then a number. Ask the user to enter each of these separately then read them in and store them in variables.
The first number must be or between and but not
The second string should have length
The third number should be greater than and even and have a remainder of when divided by
If the conditions are met, print a success message to the user. Otherwise, print a message that they failed to guess the code.
Compile and run code in NetBeans.
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