A simple console-based Java quiz application using basic control flow and user input handling.
This is a simple console-based quiz application built using Java. It presents the user with multiple-choice questions, takes input from the user, evaluates answers, and shows the final score at the end.
- โ Multiple-choice questions
- โ User input via console (Scanner)
- โ Score calculation
- โ Clean, beginner-friendly Java code
- โ Easy to modify or expand with more questions
- Java (Core)
- Console I/O (Scanner Class)
- Arrays / Loops / Conditionals
-
Clone the repository: git clone https://github.com/harshshrivastava2005/Quiz-App.git
-
Navigate to the folder: cd Quiz-App
-
Compile the Java file: javac Quiz-App.java
-
Run the app:
-
java Quiz-App
-
- What is the full form of JVM? A. Java Very Machine B. Java Virtual Machine C. Just Virtual Machine D. Java Variable Mode Your answer (A/B/C/D): B ? Correct!
-
What is the index of the last element in an array of size n? A. n B. n-1 C. n+1 D. n/2 Your answer (A/B/C/D): B ? Correct!
-
Which of the following is the correct way to declare an array in Java? A. int arr[] = new int(5); B. int arr[] = int[5]; C. int arr[] = new int[5]; D. int arr() = new int[5]; Your answer (A/B/C/D): C ? Correct!
-
Which loop is guaranteed to run at least once? A. for B. while C. do-while D. foreach Your answer (A/B/C/D): C ? Correct!
-
What does OOP stand for? A. Object Oriented Program B. Object Oriented Programming C. Operational Oriented Programming D. Ordinary Object Programming Your answer (A/B/C/D): B ? Correct!
Quiz Finished! Your total score is : 5/5
- Improve understanding of Java fundamentals
- Practice arrays, conditionals, loops, and user input
- Build small Java projects for portfolio
Harsh Shrivastava
๐ง [harshshrivastava2005@gmail.com]
LinkedIn | GitHub