JAVA-SE-Tutorial-codeswithpankaj
JAVA-SE-Tutorial-codeswithpankaj copied to clipboard
Assignment Question Password Checker with MCQ Question
Develop a Java program that implements a Password Checker and an MCQ Exam system. The program should:
- Prompt the user to set a password.
- Allow the user to enter their password three times. If the password is incorrect, display a message indicating the number of remaining attempts.
- If the user enters the correct password, start the MCQ Exam.
- Display a question and four possible answers.
- Prompt the user to select an answer.
- If the user selects the correct answer, display the next question.
- If the user selects an incorrect answer, display a message indicating that they will try again next year.
- Use appropriate data structures (e.g., arrays, ArrayList) to store the questions and answers.
- 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...
- Who invented Java Programming?
- ) Guido van Rossum
- ) James Gosling
- ) Dennis Ritchie
- ) Bjarne Stroustrup
Select Answer: 2
wrong answer [ Try Next year ]
Note: if select Right Answer ask 2nd Question ...
- Which component is used to compile, debug and execute the java programs?
- ) JRE
- ) JIT
- ) JDK
- ) JVM
Select Answer: 2
... continue with the next question