Anda di halaman 1dari 42

A

Mini Project Report


On

“Guessing Word Game”


Using CPP
Submitted to
The Department Of Computer Studies
SIBER, Kolhapur
(An Autonomous Institute)
FOR THE PARTIAL FULFILLMENT OF
MASTER OF COMPUTER APPLICATION
(MCA - II) (SEM – III)
By

Miss. Sayali Baburao Dabade.


Miss. Mansi Dhanajirao Mandlik.

Under the guidance of

Prof. Mr. R. T. Thorat.

CHH. SHAHU INSTITUTE OF BUSINESS


EDUCATION & RESEARCH
KOLHAPUR
2019-20
1 |P a g e
CHH. SHAHU INSTITUTE OF BUSINESS
EDUCATION & RESEARCH ,
KOLHAPUR

Certificate

Department Of Computer Studies

This is to certify that, the mini project report


entitled “Guessing Word Game”is the record of project work,
carried out in this college by Miss. Sayali Baburao Dabade. Miss.
Mansi Dhanajirao Mandlik.For the partial requirement of the
MCA-II (Sem -III) Examination of the Chh. Shahu Institute of
Business Education & Research, Kolhapur during the academic
year 2018 - 2019.

Date:

Prof. Mr. R. T. Thorat. Dr. R. V. Kulkarni


Project Guide Examiner H.O.D

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.

We understand that any such copying is liable to punish in a way that


University Authorities deem fit.

Place:
Date:

Miss. Sayali Baburao Dabade.


Seat no:
Miss. Mansi Dhanajirao Mandlik.
Seat no:
3 |P a g e
Acknowledgement
We are sincerely expressing our deep felt gratitude to a number of people
who have helped us throughout our project work.

We wish to express by indebtedness and thankfulness to our H.O.D.


Dr.R.V.Kulkarni their encouragement without which we could not complete our
project task.

We would also like to convey our feeling of gratitude to our guide

Mr. R. T. Thorat. who has guided us throughout our project work with his immense
knowledge and has encouraged us throughout.

Also we would like to take an opportunity to thank other Computer


Faculty, Prof. S. S. Jamsandekar, Mr. R. M. Huddar, Prof .Mrs. R. S. Kamath
and Prof. Dr. Mrs. P.G. Naik, for extending their full support.

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:

Miss. Sayali Baburao Dabade.


Miss. Mansi Dhanajirao Mandlik.

4 |P a g e
INDEX

Sr No. Chapter Name Page No


1 Introduction 7

2 Scope of Project 8

3 Methodologies 8
4 System Analysis 9

5 Feasibility Study Analysis 10

6 System Designing 13

A] use case diagram

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

This project is to analyze of player’s general knowledge.

In the game of guessing word, the computer chooses a word at random

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.

This program is an interactive guessing word game. The

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

calculations in the code, but it did require a lot of loops.

7 |P a g e
2. Scope of the Project

● The scope of this project is to develop our skills.

● Entertainment purpose and to accomplish good grades.

3. Methodologies
Following methodologies were adopted while developing the
website.

● After completely studying the system, Use case, Class model

drawn.

● Admin was given the authorization to choose the given


options.

8 |P a g e
4. System Analysis

To design any system, one must know, what is the

problem, before it can be solved and what are the different

problems or error in existing system. And then after

developing the system what are the benefits of the developed

system. Requirements for both the system & the software must

be documented and viewed through the point of view of

customer.

Followings are the websites from which the information

is collected:-

www.google.com

9 |P a g e
5. Feasibility Study Analysis

“Feasibility Study” is a test of the system

according to its workability, impact of the organization, ability

to meet user needs and effective use of the resources. We can

test our system by different type of the feasibilities. There are

5 types of the feasibilities which are discussed here. These are

as follows:

1. Technical Feasibility:

A study of resources availability that may

affect the ability to achieve an acceptable system. This

evaluation determines whether the technology needed for

the proposed system is available or not. This system can

10 | P a g e
be made in any language that support good user interface

and easy database handling

2. Operational Feasibility:

In this feasibility we consider following points:

1. What changes will be brought with the system.

2. What new skills will be required? Do the existing staff

members have these skills? If not, can they be trained in

due course of time? In the new system we made some

major changes for the staff members so that they have to

be trained to use the newly added facilities. These major

changes are possible and give a new era in the General

store sales management

11 | P a g e
3. Economical Feasibility:

It is basically beneficial analysis of the proposed

system. The cost must be including in terms of computer,

hardware, software system analysis and design. Programming,

training, installing and operating cost intangible benefits have

faster and more accurate information. Start up cost includes

the hardware and software, rental or depreciation change

salaries of maintenance staff, input data preparation etc.

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.

Hard Disk: -20 GB or above.

Monitor: - 15.6 “ HD

B] Software Requirement:

Operating system: - Windows 8/10

Front End: - Dev-C++

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>

const int MAXLENGTH=80;


const int MAX_TRIES=5;
const int MAXROW=7;

int letterFill (char, char[], char[]);


void initUnknown (char[], char[]);
int selectCategory();
using namespace std;
int main ()
{
// clrscr();

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]);

// Initialize the secret word with the * character.


//initUnknown(word, unknown);

// welcome the user


cout <<
"\n\n=%=%=%=%=%=%=%=%=%=%=%=%=%=% ~
WELCOME TO WORDS GUSSING GAME ~
=%=%=%=%=%=%=%=%=%=%=%=%=%=%";
cout << "\n\n ------------------ Game Instruction -------------
------";

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;
}

int letterFill (char guess, char secretword[], char guessword[])


{
int i;
int matches=0;
for (i = 0; secretword[i]!='\0'; i++)
{

// Did we already match this letter in a previous


guess?
31 | P a g e
if (guess == guessword[i])

return 0;

// Is the guess in the secret word?


if (guess == secretword[i])
{
guessword[i] = guess;
matches++;
}
}
return matches;
}

// Initialize the unknown word

32 | P a g e
void initUnknown (char word[], char unknown[])
{
int i;

int length = strlen(word);


for (i = 0; i < length; i++)
unknown[i]='*';
unknown[i]='\0';
}

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

we could make it more complex by getting the computer to count the

guesses until the person guesses the right word

we could have included a loop in our guessing game so that it worked

better and was more complex.

To analyze player’s general knowledge.

It will be easier to conduct the game.

To make more interest in players towards playing the brain games

like Guessing games.

41 | P a g e
11. Bibliography

Site Referred-

 www.google.com

 cplusplus.com

42 | P a g e

Anda mungkin juga menyukai