Question: 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 25 or between 45 and 88 but not 68
The second string should have length 2
The third number should be greater than 0 and even and have a remainder of 3 when divided by 7.
If the 3 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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!