Certificate
Date:
2 |P a g e
Declaration
To,
The Director,
SIBER, Kolhapur
Sir,
We undersigned Miss. Sayali Baburao Dabade. and
Miss. Mansi Dhanajirao Mandlik.Here by declare that, the project report
“Guessing Word Game” submitted by us, under the guidance of Prof.
Mr. R. T. Thorat. is our original work. The project presented is developed by us
independently and is not duplication from any other source.
The work is here by submitted to Chh. Shahu Institute of Business
Education & Research, Kolhapur for the partially fulfillment of MCA-II (Sem-III)
Mini Project.
Place:
Date:
Mr. R. T. Thorat. who has guided us throughout our project work with his immense
knowledge and has encouraged us throughout.
We would also thank to Mr. M.B. Patil for helping us and making the lab
available whenever required.
Lastly, we would also thank to our parents and friends who have helped us
directly and indirectly.
Place: Kolhapur
Date:
4 |P a g e
INDEX
2 Scope of Project 8
3 Methodologies 8
4 System Analysis 9
6 System Designing 13
7 System Requirement 15
A]Hardware Requirement
B] Software Requirement
8 Source Code 17
9 Output Screen 34
10 Conclusion 41
11 Bibliography 42
5 |P a g e
1. INTRODUCTION
6 |P a g e
1. Introduction to Project
from words. This word is the answer. The player then tries to guess
the word, by guessing one letter at a time. Whenever the user guesses
a letter that is the answer, all occurrences of that letter are revealed to
the user. The game ends when the user chooses the quite option.
focus is to use and manipulate strings and loops. The purpose of the
program is to have some fun at work when you’ve finished all of your
projects and you do not have internet access or games! There are no
7 |P a g e
2. Scope of the Project
3. Methodologies
Following methodologies were adopted while developing the
website.
drawn.
8 |P a g e
4. System Analysis
system. Requirements for both the system & the software must
customer.
is collected:-
www.google.com
9 |P a g e
5. Feasibility Study Analysis
as follows:
1. Technical Feasibility:
10 | P a g e
be made in any language that support good user interface
2. Operational Feasibility:
11 | P a g e
3. Economical Feasibility:
12 | P a g e
6. SYSTEM
DESIGNING
13 | P a g e
A] USE CASE DIAGRAM
14 | P a g e
7. SYSTEM
REQUIREMENT
15 | P a g e
A] Hardware Requirement:
Processor: - Intel core i3
RAM: - 4-RAM.
Monitor: - 15.6 “ HD
B] Software Requirement:
16 | P a g e
8. SOURCE
CODE
17 | P a g e
#include <iostream>
#include <time.h>
#include <stdlib.h>
#include <string.h>
#include <conio.h>
18 | P a g e
char unknown [MAXLENGTH];
char letter;
int range = 0;
int max = 9;
bool isSelected = false;
string play = "Play Game";
string quit = "Quit";
int num_of_wrong_guesses=0;
int choice = 0;
int catchoice = 0;
char word[MAXLENGTH];
char mobiles[][MAXLENGTH]
={"lenovo","samsung","oppo","realme","nokia","sony","vi
vo","oneplus","lg","xiaomi"};
char animals[][MAXLENGTH] =
{"tiger","lion","fox","monkey","cat","dog","snake","eleph
ant","horse","ziraf"};
char sports[][MAXLENGTH] =
{"cricket","football","tennis","volleyball","gymnastics","swi
mming","boxing","hockey","badminton","diving"};
19 | P a g e
//choose and copy a word from array of words randomly
//randomize();
//int n=random(10);
int n=0;
srand(time(NULL));
// n = rand() % 10;
// cout<<"number :"<<n;
// strcpy(word,mobiles[n]);
20 | P a g e
cout << "\n | 1. Each letter is represented by a star. (*)
|";
cout << "\n | 2. Select only one letter in one try
|";
cout << "\n | 3. You have " << MAX_TRIES << " tries to
try and guess the word. |";
cout << "\n
==============================================
=========";
//cout <<
"\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~";
do{
cout << "\n\n 1."<<play<<"\t 2."<<quit<<"\n\n";
cout << "Select Your Choice :";
cin >> choice;
switch(choice){
case 1 :
if(isSelected==false){
21 | P a g e
functioncall: catchoice =
selectCategory();
n = rand() % 10;
//cout<<"number :"<<n;
if(catchoice==1){
strcpy(word,animals[n]);
initUnknown(word,
unknown);
isSelected = true;
}else if(catchoice==2){
strcpy(word,mobiles[n]);
initUnknown(word,
unknown);
isSelected = true;
}else if(catchoice==3){
strcpy(word,sports[n]);
initUnknown(word,
unknown);
isSelected = true;
}else{
22 | P a g e
cout<<"\n\nPlease Select
Category Between....\n\n";
isSelected = false;
goto functioncall;
}
}
if(isSelected == true){
play = "Next Word";
quit = "Quit Game";
// Loop until the guesses
are used up
while
(num_of_wrong_guesses < MAX_TRIES)
{
cout << "\n\n\t\t\t\t"
<< unknown;
cout <<
"\n\n\tGuess a letter: ";
23 | P a g e
cin >> letter;
// Fill secret word
with letter if the guess is correct,
// otherwise
increment the number of wrong guesses.
if (letterFill(letter,
word, unknown)==0)
{
cout << endl <<
"Whoops! That letter isn't in there!" << endl;
num_of_wrong_guesses++;
}
else{
cout
<< endl << "Yahoo! correct... Keep it up!" << endl;
}
24 | P a g e
// Tell user how
many guesses has left.
cout << "You have
" << MAX_TRIES - num_of_wrong_guesses;
cout << " guesses
left." << endl;
// Check if they
guessed the word.
if (strcmp(word,
unknown) == 0)
{
cout << word
<< endl;
cout <<
"\n\t\t\t\tYeah! You got it!";
n = rand() %
10;
//cout<<"number :"<<n;
if(catchoice==1){
25 | P a g e
strcpy(word,animals[n]);
isSelected
= true;
}else
if(catchoice==2){
strcpy(word,mobiles[n]);
isSelected
= true;
}else
if(catchoice==3){
strcpy(word,sports[n]);
isSelected
= true;
}
// Initialize the
secret word with the * character.
initUnknown(word, unknown);
26 | P a g e
break;
}
if(num_of_wrong_guesses == MAX_TRIES)
{
cout <<
"\n\t\t\t\tSorry, you lose...." << endl;
cout << "\t\t\t\tThe
word was : " << word << endl;
num_of_wrong_guesses = 0;
n = rand() % 10;
//cout<<"number :"<<n;
if(catchoice==1){
strcpy(word,animals[n]);
27 | P a g e
isSelected
= true;
}else
if(catchoice==2){
strcpy(word,mobiles[n]);
isSelected
= true;
}else
if(catchoice==3){
strcpy(word,sports[n]);
isSelected
= true;
}
// Initialize the
secret word with the * character.
initUnknown(word, unknown);
break;
}
28 | P a g e
}
break;
case 2 : exit(0);
break;
default : cout << "not mentioned";
break;
}
}while(choice!=2);
getch();
return 0;
}
/* Take a one character guess and the secret word, and fill in
the
29 | P a g e
unfinished guessword. Returns number of characters
matched.
Also, returns zero if the character is already guessed. */
int selectCategory(){
int selectCat = 0;
int choice;
cout<<"=====================================
Select Words Category
====================================== ";
cout<<"\n\n 1.Animals \t 2.Mobiles Companies \t
3.Sports\n\n Select :";
cin>>choice;
switch(choice){
case 1 : selectCat = 1;
break;
case 2 : selectCat = 2;
break;
30 | P a g e
case 3 : selectCat = 3;
break;
default : selectCat = 0;
break;
}
return selectCat;
}
return 0;
32 | P a g e
void initUnknown (char word[], char unknown[])
{
int i;
33 | P a g e
9. OUTPUT
SCREEN
34 | P a g e
Introductions:
Select Category:
35 | P a g e
Guess Letter With Correct Guess:
36 | P a g e
Select Next Ward:
37 | P a g e
Guess Letter with Wrong Guess:
38 | P a g e
39 | P a g e
Quit Game:
40 | P a g e
10. Conclusion
41 | P a g e
11. Bibliography
Site Referred-
www.google.com
cplusplus.com
42 | P a g e