0% found this document useful (0 votes)
23 views22 pages

Final Project Report Format

Uploaded by

harshoberoi2050
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
23 views22 pages

Final Project Report Format

Uploaded by

harshoberoi2050
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 22

Quiz Application

PROJECT REPORT

Submitted in partial fulfillment of the

requirements for the award of the degree


of

BACHELOR OF TECHNOLOGY

IN

COMPUTER SCIENCE AND ENGINEERING

(ARTIFICIAL INTELLIGENCE & MACHINE LEARNING)

UNDER THE GUIDANCE OF Rohan Chauhan


2221602
Dr/Er. Santosh Kumar
Ritusha Consultants Pvt Ltd (RCPL)

ਆਈ. ਕੇ. ਗੁਜਰਾਲ ਪੰ ਜਾਬ ਟੈਕਨੀਕਲ ਯੂਨੀਵਰਸਿਟੀ, ਜਲੰ ਧਰ


I.K. GUJRAL PUNJAB TECHNICAL UNIVERSITY, JALANDHAR
DECLARATION

We hereby certify that the work, which is being presented in this report entitled, Quiz
Application, in partial fulfillment of the requirements for the degree of Bachelor of Technology
in Computer Science and Engineering (Artificial Intelligence & Machine Learning),
submitted in the Department of Computer Science and Engineering, Gulzar Group of
Institutes, Khanna, Punjab; by Rohan Chauhan (2221602), Syed Meraj (2221612), Harsh
Kumar (2341116), is the authentic record of our own work carried out under the supervision
of Santosh Kumar, Ritusha Consultants Pvt Ltd (RCPL).

We further declare that the matter embodied in this report has not been submitted by us
for the award of any other degree.

Candidate(s) Signature

This is to certify that the above statement made by the candidate is correct to the best of
my knowledge and belief.

Signature of HOD Signature of Supervisor

Er. Jai Parkash Dr/Er. Santosh Kumar

Date:
CERTIFICATE
ACKNOWLEDGMENT

It is our pleasure to acknowledge the contributions of all who have


helped us and supported us during this Project report.

First, we thank God for helping us in one way or another and providing
strength and endurance to us. We wish to express my sincere gratitude and
indebtedness to our supervisor, Santosh Kumar, Ritusha Consultants Pvt Ltd
(RCPL); for his intuitive and meticulous guidance and perpetual inspiration in
completion of this report. In spite of his busy schedule, he rendered help
whenever needed, giving useful suggestions and holding informal discussions. His
invaluable guidance and support throughout this work cannot be written down in
few words. We also thank him for providing facilities for my work in the
department name.

We are also humbly obliged by the support of our group members and
friends for their love and caring attitude. The sentimental support they
rendered to us is invaluable and everlasting. They have helped us through
thick and thin and enabled us to complete the work with joy and vigor. We
thank the group members for entrusting in each other and following directions,
without them this report would never have been possible.

We are also thankful to our parents, elders and all family members for
their blessing, motivation and inspiration throughout our work and bearing with
us even during stress and bad temper. They have always provided us a high moral
support and contributed in all possible ways in completion of this Capstone report.
ABSTRACT

This project involves the development of a quiz application using C++,


designed to provide an interactive and user-friendly platform for conducting
quizzes. The application incorporates key features such as question display, user
input validation, score calculation, and a seamless navigation mechanism.

Using object-oriented programming principles, the project demonstrates


effective modular design by dividing the application into components such as
question management, user interaction, and result generation. The primary goal
was to ensure the application is both efficient and easily extendable for future
enhancements, such as adding new categories or questions.

This project not only strengthens the understanding of core C++ concepts
but also showcases the practical application of file handling, control structures, and
dynamic memory management. The quiz application is a versatile tool that can be
adapted for educational or entertainment purposes, offering a valuable learning
experience for developers and users alike.
TABLE OF CONTENTS

DECLARATION 2

CERTIFICATE 3

ACKNOWLEDGMENT 4

ABSTRACT 5

1. INTRODUCTION..…………….………………………………………………7
2. PROBLEM STATEMENT……………………………………………………8
3. SCOPE OF THE PROJECT………………………………………………….10
4. IMPLEMENTATION…………………………………………………………12
5. CONCLUSION………………………………………………………………...21
6. REFERENCES………………………………………………………………...22
INTRODUCTION

In the modern era of digital transformation, technology has become an integral part
of education and entertainment. Interactive applications such as quizzes not only serve as
effective tools for learning and evaluation but also offer an engaging way to test
knowledge and stimulate curiosity. The Quiz Application developed in C++ embodies this
concept, aiming to provide an efficient, user-friendly, and interactive platform for
conducting quizzes.

The primary goal of this project was to design a system that could simulate a quiz
environment, providing users with a seamless experience while testing their knowledge on
various topics. Built using C++, this project leverages the strengths of the language, such
as its speed, flexibility, and robust object-oriented programming capabilities. The
application is designed to be lightweight, easily adaptable, and suitable for both individual
and group use cases.

Through this project, the core objective was not only to build a functional
application but also to demonstrate how technology can be leveraged to make learning
more interactive and enjoyable. By emphasizing simplicity, functionality, and user
experience, this quiz application is a step toward creating accessible tools that cater to
diverse audiences, from students to professionals.

The Quiz Application developed in C++ is a robust, practical, and innovative


solution for creating and conducting quizzes. It highlights the potential of programming in
designing systems that are not only functional but also impactful, aligning with the
growing trend of digital solutions in education and entertainment.
PROBLEM STATEMENT

Most quiz applications either depend heavily on internet connectivity or are overly
complex, making them inaccessible for users with limited technical skills or resources.
Additionally, these applications often lack the flexibility to allow users to customize their
quiz content or control the overall quiz flow.

Some of the key drawbacks of existing quiz applications include:


•Internet Dependency: Many quiz applications require constant internet access, limiting
their use in offline scenarios, especially in remote areas or during travel.

•Complex User Interfaces: Most platforms come with cluttered or unintuitive interfaces,
making them difficult to navigate for non-technical users.

•Limited Customizability: Many applications offer preloaded quizzes with fixed


content, preventing users from adding their own questions or modifying the difficulty
level.

•Resource Intensity: Advanced applications often consume significant system resources,


making them unsuitable for older or less powerful devices.

•High Costs: Premium features such as detailed analytics, ad-free experiences, or content
customization are often locked behind paywalls
In contrast, the Quiz Application developed by us addresses these issues by
offering a lightweight, offline, and highly customizable solution. The application is
designed with simplicity and efficiency in mind, ensuring that it is easy to use while
meeting the core needs of its users.

Key advantages of this quiz application over others include:

1. Offline Functionality: Unlike many existing applications, this system operates


entirely offline, making it accessible anytime and anywhere without the need for an
internet connection.

2. Lightweight and Efficient: Built using C++, the application is optimized for
performance, ensuring it runs smoothly even on older devices or low-resource
systems.

3. Customization: Users can create their own quiz questions, set difficulty levels, and
manage the question bank with ease, making it suitable for a wide range of
applications, from education to corporate training.

4. Simple and Intuitive Design: The application features a user-friendly interface that
is easy to navigate, even for those with minimal technical knowledge.

5. Cost-Effectiveness: The application is free from subscription models or hidden costs,


making it accessible to users of all backgrounds.
SCOPE OF THE PROJECT

The scope of this project encompasses the design, development, and deployment of a
feature-rich quiz application built using C++. The application is designed to serve as a
lightweight, offline, and customizable platform for creating and conducting quizzes. It aims to
provide a solution that is adaptable for various use cases, including educational assessments,
corporate training, and general knowledge tests.

Functional Scope:-

1. User Interaction:
1. Simple and intuitive interface for participants to answer questions, navigate quizzes,
and submit answers.
2. Real-time feedback on answers and overall scores at the end of the quiz.

2. Result Evaluation:
1. Automatic scoring based on the user's input.
2. Displays detailed results, including the number of correct and incorrect answers

3. Customization:
1. Flexible design to allow users to add, delete, or modify questions.
2. Options to set the difficulty level or category of questions.

4. Offline Functionality:
1. Fully functional without requiring internet connectivity, making it ideal for remote
areas or offline use cases.
Non-Functional Scope:-
•Efficiency:
•Optimized for speed and low memory usage, ensuring smooth performance even on older
systems.

•Scalability:
•Modular design allows for the easy addition of new features, such as a graphical user
interface (GUI) or multimedia support for questions.

•Portability:
•The application can run on any system with basic C++ support, ensuring compatibility across
multiple platforms.

•Reliability:
•Robust error-handling mechanisms to ensure smooth operation, even in the case of invalid
user inputs or system failures.

Out of Scope:-

1. Advanced Features:
1. The current version does not include a graphical user interface (GUI) or online
multiplayer functionality but can be extended in future iterations.

2. AI-Based Features:
1. No integration of AI for automatic question generation or adaptive difficulty at this
stage.

3. Multimedia Support:
1. The application does not support audio, video, or image-based questions in its
current state.
IMPLEMENTATION

The quiz application was implemented using C++ programming, focusing on modularity,
efficiency, and user-friendly design. The development process involved breaking the application
into functional components to ensure that each module is independent and reusable. The key
components of the implementation are described below:

1. Project Structure:-
The application is divided into several modules:

•Main Menu Module: Handles the user interface for navigating between options (e.g., starting
the quiz, adding questions, viewing scores).

•Question Bank Module: Manages the storage and retrieval of questions and answers, using file
handling for persistence.

•Quiz Logic Module: Controls the flow of the quiz, including displaying questions, taking user
input, and validating answers

•Result Calculation Module: Computes the score and provides detailed feedback on the user’s
performance.
2. Key Functionalities:-

(a) Question Bank Management:


Questions and answers are stored in a file (e.g., questions.txt) to ensure persistence across
sessions. The application uses file handling techniques to read and write data from/to the
file. Users can add new questions by providing the question text, answer choices, and the
correct answer.

(b) Quiz Execution:


Questions are fetched from the file and displayed to the user one at a time. User input is
validated to ensure correctness and prevent invalid entries. Correct answers are tracked to
calculate the final score.

(c) Result Calculation:


After completing the quiz, the user’s score is calculated and displayed. The result
includes the total number of questions attempted and the number of correct answers.
3. User Interface:-

The application uses a text-based interface to interact with users. It provides options like:
(a) Start Quiz
(b) Choose Difficulty
(c) View Scores
(d) Exit

4. Error Handling:-

The application includes error-checking mechanisms, such as validating file operations and
user input.

5. Modular Design:-

Each functionality is implemented as a separate function, promoting code reusability and


readability. The modular design also makes it easier to extend the application with new features
in the future.
6. PROGRAM:-

#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
using namespace std;

int Guess;
int Total;

class info {
string name[10];
int age[10];
int choose;
public:
void detail(int n) {
for (int i = 0; i < n; i++) {
cout << endl;
cout << "Player " << i + 1 << " name: ";
cin >> name[i];
cout << "Player " << i + 1 << " age: ";
cin >> age[i];
cout << endl;
}
}
void show(){
cout << "Choose difficulty: " << endl << endl;
cout << "1.Easy" << endl;
cout << "2.Medium" << endl;
cout << "3.Hard" << endl;
cin >> choose;
}

string getName(int i) {
return name[i];
}
};
class Question {
private:
string Question_Text;
string Option_1;
string Option_2;
string Option_3;
string Option_4;
int Correct_Answer;
int Question_Score;

public:
void setValues(string q, string a1, string a2, string a3, string a4, int ca, int pa) {
Question_Text = q;
Option_1 = a1;
Option_2 = a2;
Option_3 = a3;
Option_4 = a4;
Correct_Answer = ca;
Question_Score = pa;
}

void askQuestion() {
cout << endl;
cout << Question_Text << endl;
cout << "1. " << Option_1 << endl;
cout << "2. " << Option_2 << endl;
cout << "3. " << Option_3 << endl;
cout << "4. " << Option_4 << endl;
cout << endl;

cout << "Your answer: ";


cin >> Guess;
cout << "Answer submitted" << endl;

if (Guess == Correct_Answer) {
Total += Question_Score;
} else {
cout << endl;
}
}
};
int main() {
int n;
string Respond;
cout << "\nTHE QUIZ" << endl << endl;
cout << "Enter the number of players: ";
cin >> n;

info arr;
arr.detail(n);
arr.show();

Question q1, q2, q3, q4, q5, q6, q7, q8, q9, q10, q11;

q1.setValues("Question 1: What is the largest lake in the world?", "Caspian Sea", "Baikal",
"Lake
Superior", "Ganga", 1, 10);
q2.setValues("Question 2: Which planet in the solar system is known as the Red Planet?",
"Venus",
"Earth", "Mars", "Jupiter", 3, 10);
q3.setValues("Question 3: What is the capital of Japan?", "Beijing", "Tokyo", "Seoul",
"Bangkok", 2,
10);
q4.setValues("Question 4: What gas is used to extinguish fires?", "Oxygen", "Nitrogen",
"Carbon
dioxide", "Hydrogen", 3, 10);
q5.setValues("Question 5: Which is the richest country in the world?", "Qatar", "Russia",
"USA", "UAE",
1, 10);
q6.setValues("Question 6: How many bones are in the body of an adult human?", "200",
"206", "210",
"208", 2, 10);
q7.setValues("Question 7: Which country is famous for its pyramids and the Sphinx?", "India",
"China",
"Mexico", "Egypt", 4, 10);
q8.setValues("Question 8: What year was the Olympic Organization founded?", "1886",
"1896", "1900",
"1912", 2, 10);
q9.setValues("Question 9: How many times has Brazil won the FIFA World Cup?", "4", "2",
"5", "1", 3,
10);
q9.setValues("Question 9: How many times has Brazil won the FIFA World Cup?", "4", "2", "5",
"1", 3,
10);
q10.setValues("Question 10: In which year, did terrorists crash two planes into New York’s
World Trade
Centre?", "2000", "2001", "2002", "2003", 2, 10);
q11.setValues("What year did the Titanic sink in the Atlantic Ocean?", "1913", "1912",
"1812", "1920",
2, 10);

vector<pair<string, int>> leaderboard;

for (int i = 0; i < n; i++) {


Total = 0;

cout << "\nAre you ready for the quiz, " << arr.getName(i) << "? Yes/No" << endl;
cin >> Respond;

if (Respond == "yes" || Respond == "Yes") {


cout << endl;
cout << "Good Luck, " << arr.getName(i) << "!" << endl;

q1.askQuestion();
q2.askQuestion();
q3.askQuestion();
q4.askQuestion();
q5.askQuestion();
q6.askQuestion();
q7.askQuestion();
q8.askQuestion();
q9.askQuestion();
q10.askQuestion();

cout << "Total Score for " << arr.getName(i) << " = " << Total << " out of 100" << endl;

leaderboard.push_back(make_pair(arr.getName(i), Total));
} else {
cout << "Okay, " << arr.getName(i) << ", Good Bye!" << endl;
leaderboard.push_back(make_pair(arr.getName(i), 0));
}
}
sort(leaderboard.begin(), leaderboard.end(), [](pair<string, int> a, pair<string, int> b) {
return a.second > b.second;
});

cout << "\nLeaderboard:\n";


for (int i = 0; i < leaderboard.size(); i++) {
cout << i + 1 << ". " << leaderboard[i].first << " - " << leaderboard[i].second << " points"
<< endl;
}

if (!leaderboard.empty()) {
if (leaderboard.size() > 1 && leaderboard[0].second == leaderboard[1].second) {
cout << "\nTop players are tied. Let’s ask the golden question to determine the winner!\
n";
vector<int> tiedPlayers;
for (int i = 0; i < leaderboard.size(); i++) {
if (leaderboard[i].second == leaderboard[0].second) {
tiedPlayers.push_back(i);
}
}

vector<pair<string, int>> goldenLeaderboard;


for (int i : tiedPlayers) {
Total = leaderboard[i].second;
cout << "\nGolden Question for " << leaderboard[i].first << ":\n";
q11.askQuestion();
goldenLeaderboard.push_back(make_pair(leaderboard[i].first, Total));
}

sort(goldenLeaderboard.begin(), goldenLeaderboard.end(), [](pair<string, int> a,


pair<string, int>
b) {
return a.second > b.second;
});
if (goldenLeaderboard.size() > 1 && goldenLeaderboard[0].second ==
goldenLeaderboard[1].second) {
cout << "\nMatch drawn with " << goldenLeaderboard[0].second << " points!" <<
endl;
} else {
cout << "\nThe winner is " << goldenLeaderboard[0].first << " with " <<
goldenLeaderboard[0].second << " points!" << endl;
}
} else {
cout << "\nThe winner is " << leaderboard[0].first << " with " << leaderboard[0].second
<< "
points!" << endl;
}
}

return 0;
}
CONCLUSION

Through this project, a lightweight, offline, and customizable platform for conducting
quizzes was successfully designed and implemented. The application serves as a versatile tool for
various use cases, including educational assessments, corporate training, and personal knowledge
enhancement.

The development process demonstrated the practical application of key programming


concepts, such as file handling, modularity, and structured programming, all of which were
crucial in building a reliable and robust system. By focusing on simplicity, performance, and user
experience, this application addresses the limitations of many existing quiz platforms, such as
their dependence on internet connectivity and lack of customizability.
The project achieved its primary objectives, including:
1. Enabling users to choose difficulty level.
2. Providing a seamless, interactive interface for taking quizzes.
3. Automatically calculating and displaying results with accuracy.

In conclusion, this project not only fulfills its intended purpose but also highlights the
importance of technology in making education and assessment more accessible and engaging. It
stands as a practical and innovative solution for conducting quizzes, proving that simple tools
can have a significant impact when designed thoughtfully. Moreover, it underscores the value of
continuous learning and development in creating solutions that bridge the gap between
traditional methods and modern digital advancements.
REFERENCES

•Books and Study Materials:-


•Balagurusamy, E. (2017). Object-Oriented Programming with C++. McGraw Hill
Education.
•Stroustrup, B. (2013). The C++ Programming Language. Addison-Wesley.
•Schildt, H. (2018). C++: The Complete Reference. McGraw Hill Education.

•Online Tutorials and Documentation:-


•GeeksforGeeks. "C++ Programming Language". https://www.geeksforgeeks.org/c-plus-
plus/
•Tutorialspoint. "C++ Programming Tutorial“
https://www.tutorialspoint.com/cplusplus/

Research Papers and Articles:-


•Mittal, A., & Bhatia, A. (2010). "Software Development using C++: A Case Study".
International Journal of Computer Applications.
•Wirth, N. (1988). "Algorithms + Data Structures = Programs". Prentice-Hall.

You might also like