Java Quiz 1

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 16

Java based quiz application

“VISVESVARAYA TECHNOLOGICAL UNIVERSITY, BELAGAVI”

B.L.D.E.A's V.P. DR. P.G. HALAKATTI COLLEGE OF


ENGINEERINGAND TECHNOLOGY, VIJAYAPUR -- 586103

BACHELOR OF ENGINEERING IN INFORMATION SCIENCE &


ENGINEERING

Internship
JAVA FULL STACK DEVELOPMENT
(21INT49)

MINI PROJECT REPORT ON:


“QUIZ APPLICATION”

UNDER THE GUIDANCE OF

BHEEMESH RAGHUPATHY

SUBMITTED BY:
PRIYANKA MANNIKERI
AND
ABHISHEK GOBBI
Java based quiz application

B.L.D.E.A.’s V.P. Dr. P.G. HALAKATTI COLLEGE OF ENGINEERING


AND TECHNOLOGY, VIJAYAPURA – 586 103

DEPARTMENT OF INFORMATION SCIENCE & ENGINEERING

CERTIFICATE

This is to certify that mini project work of JAVA FULL STACK


DEVELOPMENT (21INT49) entitled “QUIZ APPLICATION” is a
bonafide work carried out in the fifth semester by PRIYANKA MANNIKERI
and ABHISHEK GOBBI in partial fulfilment for the award of Bachelor of
Engineering in Science and Engineering from B.L.D.E. A’s V. P. Dr. P. G.
Halakatti College of Engineering & Technology during the academic year
2023.

GUIDE PLACEMENT CELL PRINCIPAL

Bheemesh raghupathy PRASHANT.PATIL Dr. V.G. Sangam


Java based quiz application

INTRODUCTION

The Java-Based Quiz Application introduces a console-based program designed to engage


users in an interactive quiz-taking experience. This application leverages Java programming
concepts, specifically utilizing switch and if conditions to handle user input and evaluate quiz
questions. By offering a seamless and user-friendly quiz environment, this project aims to
provide an educational and entertaining platform for users to test their knowledge on various
topics.

The introduction outlines the purpose of the quiz application, emphasizing its focus on user
interaction and the incorporation of fundamental Java programming constructs. This section
sets the stage for the subsequent pages, offering a brief glimpse into the project's goals and
significance.

The primary objective of the Java-Based Quiz Application is to create a dynamic and
accessible quiz platform for users of varying expertise levels. This platform aims to:

Allow users to answer a series of questions covering different topics.


Provide immediate feedback on user responses to enhance the learning experience.
Implement Java switch and if conditions for efficient user input handling and question
evaluation.
The objective section delves into the specific goals of the project, highlighting the key features
and functionalities that distinguish the quiz application. By focusing on user engagement,
feedback, and the utilization of Java programming constructs, the objective is to create an
application that is both educational and enjoyable.
Java based quiz application

REQUIREMENT SPECIFICATION

Eclipse serves as an Integrated Development Environment (IDE) known for its versatility
in supporting various programming languages, with a historical emphasis on Java
development. This IDE adopts a project-centric model, wherein projects encapsulate
source code, libraries, and resources, and seamlessly integrates with popular build systems
like Apache Maven and Apache Ant.
Developers utilizing Eclipse benefit from a feature-rich code editor that facilitates the
creation of clean and efficient Java code. The IDE's capabilities include code completion,
support for code refactoring, and real-time error analysis, enhancing the overall coding
experience and promoting productivity.
One of Eclipse's notable strengths lies in its extensibility through a diverse ecosystem of
plug-ins, enabling developers to customize the IDE according to their specific
requirements and integrate additional tools seamlessly.
In terms of system requirements, Eclipse is designed to be platform-agnostic,
accommodating various operating systems such as Windows, macOS, and Linux. The
hardware requirements are generally modest, ensuring accessibility for a wide range of
developers.
Eclipse's support for version control systems, including Git and SVN, facilitates
collaborative development. The IDE provides a comprehensive environment for building,
debugging, and testing Java applications, featuring a graphical debugger and seamless
integration with JUnit for testing.
Overall, Eclipse remains a preferred choice for Java developers seeking a flexible and
feature-rich IDE, and its extensive community support ensures a wealth of resources
and knowledge for users of all proficiency levels.

 The quiz application incorporates a set of predetermined questions, each accompanied


by a list of multiple-choice options.
 Questions and options are stored in simple data structures, such as arrays or lists

 Utilizing a loop, the application iterates through each question, presenting it to the user.
 The Scanner class is employed for user input, capturing their chosen option.

 The user's response is assessed using conditional statements (if), and feedback is
provided based on correctness.
Java based quiz application

 For incorrect answers, the correct option is revealed to the user.

 A scoring mechanism is implemented to keep track of the user's correct responses.


 The final score is displayed to the user at the conclusion of the quiz.
Java based quiz application

FLOW CHART

START

USER INPUT

QUIZ LOOP

SWITCH
CASES

QUESTION ANSWER
PROSESSING

SCORE CALCULATION

END OF QUIZ
Java based quiz application
Java based quiz application

IMPLEMENTATION

package quizproject;

import java.util.Scanner;

public class KBC {


public static void main(String[] args)
{ Scanner scanner = new
Scanner(System.in); int score = 0;

System.out.println("Welcome to Kaun Banega Crorepati!");


System.out.println("Answer the following questions to win.");

// Questions and options


String[] questions = {
"1. What is the capital of The United States of America?",
"2. Which Indian state has highest GDP ?",
"3. Which city ranks first as most populated city in world?",
"4. Which city ranks first as most polluted city by AQI in world?",
"5. Which countries are kangaroos native to?",
"6. Which African country has highest
population?", "7. Which country has highest GDP
per capita?", "8, Which country hosted G20
summit 2023?",
"9. Who is known as father of modern physics?",
"10. Who is known as father of medicine?"
};

String[][] options = {
Java based quiz application
{"a) Washington DC", "b) New York", "c) Pensylvania", "d) London"},
Java based quiz application

{"a) Maharashtra", "b) Karnataka", "c) Uttar Pradesh", "d) Bihar"},


{"a) New delhi", "b) Tokyo", "c) Hong Kong", "d) New York"},
{"a)Bengaluru","b) New Delhi", "c) Dhaka","d) Lahore"},
{"a)Bangladesh","b) Sri lanka","c)Australia","d) United Kingdom"},
{"a)Nigeria,","b)Egypt","c)South Africa","d)Zambia"},
{"a)Monaco","b)Sweden","c)Denmark","d) Lebanon"},
{"a) China","b) Australia", "c) United Kingdom ","d) India"},
{"a)Einstein","b)Tesla","c)Issac Newton","d)Marie Curie"},
{"a)Aristotle","b)Hippocrates","c)Sushrutha","d)Robert cook"}

};

String[] correctAnswers = {"a", "a", "b","b","c","a","a","d","c","b"};

// Display and process questions


for (int i = 0; i < questions.length; i++) {
System.out.println(questions[i]);
for (String option : options[i]) {
System.out.println(option);
}

System.out.print("Your answer: ");


String userAnswer = scanner.nextLine().toLowerCase();

if (userAnswer.equals(correctAnswers[i])) {
System.out.println("Correct!\n");
score += 1000; // You can adjust the scoring as needed
} else {
System.out.println("Incorrect. The correct answer is " + correctAnswers[i] + ".\n");
break; // End the game if the answer is incorrect
}
}

// Display final score


System.out.println("Congratulations! You won: rs" + score);
}}
Java based quiz application

OUTPUT
Java based quiz application
Java based quiz application
Java based quiz application

CONCLUSION
In conclusion, the Java quiz application stands as a commendable endeavor in
combining educational engagement with user-friendly interactivity. The
application's modular design, featuring a variety of question types and
immediate feedback, facilitates an enriching learning experience for users.
The scalability of the application allows for effortless expansion, enabling the
addition of new questions and topics.

The repeatable nature of the quiz, coupled with the comprehensive score
tracking system, empowers users to revisit the application, reinforcing their
knowledge and challenging themselves to achieve higher scores. The
application's low system requirements enhance accessibility, making it
available to a diverse audience across different devices.

Beyond its educational value, the quiz application injects an element of


entertainment into the learning process, fostering a more enjoyable user
experience. The convenience of platform independence, thanks to its Java
implementation, ensures accessibility on a wide array of devices.

Moreover, the potential for community engagement, especially if deployed


online, can create a shared learning experience. Users may share their scores,
compete with others, and collectively contribute to a collaborative and
engaging community.

In consideration of these factors, the Java quiz application not only serves as
a tool for educational enrichment but also as a platform for fostering a sense
of community and enjoyment in the pursuit of knowledge. Its adaptability
and ease of use make it a valuable resource for both individual learners and
educational institutions. As the application continues to evolve, it holds the
promise of further enhancements and community-driven contributions,
contributing to its enduring value in the realm of interactive educational tools
Java based quiz application
Java based quiz application

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy