You are on page 1of 20

Computing and Programming Fundamentals

CE – 101
Fall Semester 2020-21
FINAL PROJECT

Submitted by:
Faizan khan (ROLL NO: 143)
Arisha Fateh (ROLL NO: 117)
Syed Aoun Raza Naqvi (ROLL NO:
104)
Section: - C
Submitted to : - Sir Ali Akbar

1
Department of Computer Engineering
Sir Syed University of Engineering and Technology
TABLE OF CONTENT:
S.NO CONTENTS
1 ACKNOWLEDGE

2 INTRODUCTION TO C LANGUAGE
3 PROJECT OVERVIEW
4 PROGRAM
5 CONCLUSION

ACKNOWLEDGE:
We would like to thank our beloved “SIR ALI AKBAR”, the faculty of
our course Computing & Programming Fundamental (CE-101L and
CE-101T)

For his professional teaching throughout this project. In this project


we will show you what we have learned during online classes. In this
project and we got to know so many important things and here are
some our skills that we want to show you. who gave me the golden
opportunity to do this wonderful project on the topic (Quiz game)
which also helped us in doing a lot of Research and we came to
know about so many new things We are really thankful to him.

Yours faithfully,

2
Department of Computer Engineering
Sir Syed University of Engineering and Technology
INTRODUCTION

On-line examinations contents providers to focus on creating


effective assessment.
questions and focusing on exam’s feedback delivery to
students. In the paper we present techniques that are pertinent to
the elements of assessment process: answers submission,
computerized grading, and feedback after submission.
As the modern organizations are automated and computers are
working as per the instructions, it becomes essential for the
coordination of human beings, commodity and
computers in a modern organization.
The administrators , instructor, Students who are attending for online
examination can communicate with the system through this projects,
thus facilitating effective implementation and monitoring of various
activities of Online Examinations like conducting Exams as per
scheduled basis and delivering result to that particular use or
student. And the details of students who attempted Online
Examination are maintained at administrator.

3
Department of Computer Engineering
Sir Syed University of Engineering and Technology
INTRODUCTION TO C LANGUAGE:

C is a general-purpose programming language that is extremely popular,

simple, and flexible to use. It is a structured programming language that is

machine-independent and extensively used to write various applications,

Operating Systems like Windows, and many other complex programs like

Oracle database, Git, Python interpreter, and more.


C is a procedural programming language. It was initially developed
by Dennis Ritchie in the year 1972. It was mainly developed as a
system programming language to write an operating system. The
main features of C language include low-level access to memory, a
simple set of keywords, and clean style, these features make C
language suitable for system programmings like an operating
system or compiler development.
Many later languages have borrowed syntax/features directly or
indirectly from C language. Like syntax of Java, PHP, JavaScript,
and many other languages are mainly based on C language. C++ is
nearly a superset of C language (There are few programs that may
compile in C, but not in C++).

4
Department of Computer Engineering
Sir Syed University of Engineering and Technology
PROJECT OVERVIEW:
INTRODUCTION TO THE PROJECT:
This project is totally based on “Quiz Game ”.

This project is all about quiz game . When user will open this project
some options will get displayed on the screen such as , start the quiz
and end the quiz now it’s totally upto the user to choose whatever
option he wants to . If he wants to play the game then user will
definitely choose (start the quiz) and by picking up that option he will
be asked to write his first and last name and project will show the
player name. After this little process player will get three questions
each question containing 5 marks after going through this questions
answers period , he will be rewarded his marks out of 15 and will get
his remarks based on the marks that he has got in the quiz . In the end
it will ask the user to press any button the close the quiz . If the user
chooses the second option which is (end the quiz) in the very beginning
then quiz will be closed without displaying any of the above mentioned
process

5
Department of Computer Engineering
Sir Syed University of Engineering and Technology
6
Department of Computer Engineering
Sir Syed University of Engineering and Technology
7
Department of Computer Engineering
Sir Syed University of Engineering and Technology
Command Used in program are switch break statement and nested if
else loop.
The break statement is used inside the switch to terminate a statement sequence.
When a break statement is reached, the switch terminates, and the flow of control jumps
to the next line following the switch statement.
The break statement is optional. If omitted, execution will continue on into the next case.

The if statement alone tells us that if a condition is true it will execute a block of statements
and
if the condition is false it won’t. But what if we want to do something else if the condition is
false.
Here comes the C else statement. We can use the else statement with
if statement to execute a block of code when the condition is false.

8
Department of Computer Engineering
Sir Syed University of Engineering and Technology
9
Department of Computer Engineering
Sir Syed University of Engineering and Technology
Object: -
A Program for Game quiz using C Language.

Source Code: -
#include<stdio.h>
#include<conio.h>
#include<cstdlib>
int main()
{
int i,a,score,;
char first_name[100],Remarks;
char last_name[60];char ch;
system("color 74");
printf("\n\n\t\t\t
=========================================================");
printf("\n\n\t\t\t * PREPARED BY ARISHA FATEH, AOUN RAZA AND
FAIZAN KHAN *");
printf("\n\n\t\t\t
=========================================================");
printf("\n\n\t\t\t\t\t *WELCOME TO QUIZ GAME**");
printf("\n\n\t 1. START THE QUIZ : \n\t 2. QUIT THE QUIZ : \t\t\n ");
printf("\n\t ENTER A NUMBER : ");
scanf(" %d",&i);
switch (i)
10
Department of Computer Engineering
Sir Syed University of Engineering and Technology
{
case 1:
printf(" \n\n\n Enter Your First Name: ");
scanf(" %s",&first_name);
printf("\n Enter Your Last Name : ");
scanf("%s",&last_name);
printf("\n Player Name Is: %s %s",first_name,last_name);
printf("\n\n\n\t\t\t\t Press enter key to continue");
getch();
system("cls");

system("color 75");
printf("\n\n\t\t\t [ SELECT AND ENTER THE ANSWER NO... ]");
printf("\n\n\n\n\t\t\t Q1.What Is The Capital Of The Pakistan ?");
//Question 1
printf(" \n\n\n\t\t\t 1.Islamabad \n\t\t\t 2.Karachi\n\t\t\t 3.Peshawar\n");
printf("\n\t\t\tEnter your Choice: ");
scanf("\t\t\t%d",&a);

if (a==1)
printf(" \n\t\t\t CORRECT !!!");
if (a==1)
11
Department of Computer Engineering
Sir Syed University of Engineering and Technology
score=score+5;
else if (a==2,3)
printf("\n\t\t\t WRONG !!!");
printf("\n\n\t\t\t Press enter key to continue");
getch();
system("cls");
system("color 70");
printf("\n\n\t\t\t [ SELECT AND ENTER THE ANSWER NO... ]");
printf("\n\n\n\n\n\t\t\t Q2.Who is the best T20 player of Pakistan ?\n");
//Question 2
printf(" \n\n\n\t\t\t 1.Fakhar \n\t\t\t 2.Haider\n\t\t\t 3.Babar");
printf("\n\n\t\t\tEnter your Choice: ");
scanf(" %d",&a);

if (a==3)
printf(" \n\n\t\t\t CORRECT !!!");
if(a==3)
score = score+5;
else if (a==1,2)
printf("\n\t\t\t WRONG !!!");
else
printf("\n\n\t\t\t Press enter key to continue");

12
Department of Computer Engineering
Sir Syed University of Engineering and Technology
getch();
system("cls");
system("color 71");
printf("\n\n\t\t\t [ SELECT AND ENTER THE ANSWER NO... ]");
printf("\n\n\n\n\n\t\t\t Q3.Who was the captian of Pakistan when Pakistan won
the cricket world cup ?\n"); //Question 3
printf(" \n\n\n\t\t\t 1.Javed miandad \n\t\t\t 2.Imran khan\n\t\t\t 3.Waseem
Akram");
printf("\n\n\t\t\tEnter your Choice: ");
scanf(" %d",&a);
if (a==2)
printf(" \n\n\t\t\t CORRECT !!!");
if (a==2)
score = score+5;
else if (a==1,3)
printf("\n\t\t\t WRONG !!!");
else
printf("\n\n\t\t\t Press enter key to continue");
getch();
system("cls");

system("color 7C");
printf("\n\n\n\n\t\t\t Final Result: ");

13
Department of Computer Engineering
Sir Syed University of Engineering and Technology
printf("\n\n\n\n\n\t\t\t Total Score = 15 \n");
printf("\n\t\t\t Obtain Score = %d\n\n\t\t\t",score);
if(score==15)
printf(" Remarks: Excellent ");
else if(score==10)
printf(" Remarks: Good ");
else if(score==5)
printf(" Remarks: Fair ");
else if(score==0)
printf(" Remarks:Fail ");
printf("\n\n\n\n\t\t\t Press enter key to continue");

getch();
system("cls");
case 2:{
printf("\n\n\n\n\t\t\t\t press any key to quit !!!!!\n\n \t\t\t\tyou can quit the quiz\n\t\t\t");

scanf("%c",&ch);
break;
}
default :

14
Department of Computer Engineering
Sir Syed University of Engineering and Technology
printf("\n\n\t\t\t invalid option
!!!!"); break;
}
return 0;
}

15
Department of Computer Engineering
Sir Syed University of Engineering and Technology
OUTPUT

16
Department of Computer Engineering
Sir Syed University of Engineering and Technology
17
Department of Computer Engineering
Sir Syed University of Engineering and Technology
18
Department of Computer Engineering
Sir Syed University of Engineering and Technology
CONCLUSION:
In this program , we use the command of Switch and break statement
nested if else and for loop statement.

This is a complete and error-free Quiz Game Mini Project in C designed


as a simple console application. In this project, a number of questions are
asked, and the user is awarded marks for each correct answer given.

In quiz game, questions are chosen in such a a way that they cover all
fields of a typical quiz contest. The user’s general knowledge is tested with
quiz questions .

The source code is to be compiled on Dev c++. The source code for
this mini project is around 114 lines & also submitted through usb.

THANKS

19
Department of Computer Engineering
Sir Syed University of Engineering and Technology
20
Department of Computer Engineering
Sir Syed University of Engineering and Technology

You might also like