JAVA-SE-Tutorial-codeswithpankaj icon indicating copy to clipboard operation
JAVA-SE-Tutorial-codeswithpankaj copied to clipboard

Assignment Question Password Checker with MCQ Question

Open Pankaj-Str opened this issue 7 months ago • 8 comments

Develop a Java program that implements a Password Checker and an MCQ Exam system. The program should:

  1. Prompt the user to set a password.
  2. Allow the user to enter their password three times. If the password is incorrect, display a message indicating the number of remaining attempts.
  3. If the user enters the correct password, start the MCQ Exam.
  4. Display a question and four possible answers.
  5. Prompt the user to select an answer.
  6. If the user selects the correct answer, display the next question.
  7. If the user selects an incorrect answer, display a message indicating that they will try again next year.
  8. Use appropriate data structures (e.g., arrays, ArrayList) to store the questions and answers.
  9. Use conditional statements (e.g., if-else) to handle the password checking and question answering logic.

Sample Output:

Set your password: p4n@in

Enter your Password: p4n wrong password... try 2 more time out of 2

Enter your Password: p4n@ wrong password... try 1 more time

Enter your Password: p4n@34 wrong password... try 0 more time

Note: user select right password then start MCQ EXAM...

  1. Who invented Java Programming?
  2. ) Guido van Rossum
  3. ) James Gosling
  4. ) Dennis Ritchie
  5. ) Bjarne Stroustrup

Select Answer: 2

wrong answer [ Try Next year ]

Note: if select Right Answer ask 2nd Question ...

  1. Which component is used to compile, debug and execute the java programs?
  2. ) JRE
  3. ) JIT
  4. ) JDK
  5. ) JVM

Select Answer: 2

... continue with the next question

Pankaj-Str avatar Jul 16 '24 13:07 Pankaj-Str