You are on page 1of 15

K L UNIVERSITY

FRESHMAN ENGINEERING DEPARTMENT


A Project Based Lab Report

On

GAME WINNER

SUBMITTED BY:

I.D NUMBER NAME

2200080203 SAI SUMANTH M

2200080204 GOPISETTI MADHU VYSHAVI

2200080208 KOTYADA SAI CHAITANYA

2200080216 KONASANI TEJA MAHESWARA REDDY

UNDER THE ESTEEMED GUIDANCE OF

BHASKAR MARAPELLI

Assistant professor

KL UNIVERSITY
Green fields, Vaddeswaram – 522 502
Guntur Dt., AP, India.
DEPARTMENT OF BASIC ENGINEERING SCIENCES

CERTIFICATE

This is to certify that the project based laboratory report entitled


“GAME WINNER” submitted by Mr.D.V.SAI BHUVANESH bearing Regd. No.
2000031596 to the Department of Basic Engineering Sciences, KL University
in partial fulfillment of the requirements for the completion of a project based
Laboratory in “Computational Thinking and Designing” course in I B Tech I
Semester, is a bonafide record of the work carried out by him/her under my
supervision during the academic year 2020 – 2 021.

PROJECT SUPERVISOR HEAD OF THE DEPARTMENT

BHASKAR MARAPELLI Dr. D.HARITHA


ACKNOWLEDGEMENTS

It is great pleasure for me to express my gratitude to our honorable


President Sri. Koneru Satyanarayana, for giving the opportunity and platform
with facilities in accomplishing the project based laboratory report.

I express sincere gratitude to our Coordinator and HOD-BES Dr. D.Haritha


for her leadership and constant motivation provided in successful completion of
our academic semester. I record it as my privilege to deeply thank for providing
us the efficient faculty and facilities to make our ideas into reality.

I express my sincere thanks to our project supervisor DR.D.ANAND for


his/her novel association of ideas, encouragement, appreciation and intellectual
zeal which motivated us to venture this project successfully.

Finally, it is pleased to acknowledge the indebtedness to all those who


devoted themselves directly or indirectly to make this project report success.

Name: Sai Sumanth M

Reg. Id . No: 2200080203


ABSTRACT

C is a middle-level programming language developed by Dennis


Ritchie during the early 1970s while working at AT&T Bell Labs in the
USA. The objective of its development in the context of the re-design
of the UNIX operating system to enable it to be used on multiple
computers.

Earlier the language B was now used for improving the UNIX system.
Being a high-level language, B allowed much faster production of
code than in assembly language. Still, B suffered from drawbacks as it
did not understand data-types and did not provide the use of
“structures”.

These drawbacks became the driving force for Ritchie for


development of a new programming language called C. He kept most
of language B’s syntax and added data-types and many other
required changes. Eventually, C was developed during 1971-73,
containing both high-level functionality and the detailed features
required to program an operating system. Hence, many of the UNIX
components including UNIX kernel itself were eventually rewritten in
C.
INDEX
S.NO TITLE PAGE NO

1 Introduction 1-2

2 Aim of the Project 3

2.1 Advantages & Disadvantages 3

2.2 Future Implementation 3

3 Software & Hardware Details 4

4 Data Flow Diagram 5

5 Algorithm for each module 6

6 Implementation 7

7 Outputs and screen shots 8-9

8 Conclusion 10
1
INTRODUCTION

In this question we have used the following concepts:


LOOPS AND ARRAY

LOOPS:

A Loop executes the sequence of statements many times until


the stated condition becomes false. A loop consists of two parts, a body of a
loop and a control statement. The control statement is a combination of some
conditions that direct the body of the loop to execute until the specified
condition becomes false. The purpose of the loop is to repeat the same code a
number of times.

There are different kinds of loops in C language

1. FOR loop:
A for loop is a repetition control structure that allows you
times.

Syntax of for loop:

for(intiti;condition;increment)
{
Statement
}

2.While loop:

A while loop in C programming repeatedly executes a target


statement as long as a given condition is true.
Syntax of while loop:
while(condition) 2
{
Statement
increment;
}
In our program we predominantly used for loop.

Array:
Arrays is a kind of data structure that can store a fixed-size sequential
collection of elements of the same type. An array is used to store a collection
of data, but it is often more useful to think of an array as a collection of
variables of the same type.

Instead of declaring individual variables, such as number0, number1, ..., and


number99, you declare one array variable such as numbers and use
numbers[0], numbers[1], and ..., numbers[99] to represent individual variables.
A specific element in an array is accessed by an index.

All arrays consist of contiguous memory locations. The lowest address


corresponds to the first element and the highest address to the last element.

Declaring Arrays:
To declare an array in C, a programmer specifies the type of the elements
and the number of elements required by an array as follows.

arrayname[array size]
There are different kinds of arrays like one-
dimensional, two dimensional array and even three dimensional array.

1.One-Dimensional array:
It contains only one element i.e., for example in our program
we used char bname[15] here char bname represents array name and [15]
represents size of the array.
2.Two-Dimensional array:
The simplest form of multidimensional array is the two-
dimensional array. A two-dimensional array is, in essence, a list of one-
dimensional arrays. To declare a twodimensional integer array of size [x][y],
you would write something as follows
Array name[x][y]
AIM
3

Advantages:-
->We can store scores of 1000 players.And we can find the maximum
score among them if their score range in between -1000 to 1000.
Disadvantages:-
→We can not store scores of more than1000 players .
→The memory allocated to an array cannot be reduced or increased
because it’s of frozen fixed size.
Future enhancements:
The winner of the card game popular in Berland "Berlogging" is
determined according to the following rules. If at the end of the game
there is only one player with the maximum number of points, he is the
winner. The situation becomes more difficult if the number of such
players is more than one. During each round a player gains or loses a
particular number of points. In the course of the game the number of
points is registered in the line "name score", where name is a player's
name, and score is the number of points gained in this round, which is an
integer number. If score is negative, this means that the player has lost in
the round. So, if two or more players have the maximum number of
points (say, it equals to m) at the end of the game, than wins the one of
them who scored at least m points first. Initially each player has 0 points.
It's guaranteed that at the end of the game at least one player has a
positive number of points.
Input:
The first line contains an integer number n (1  ≤  n  ≤  1000), n is the
number of rounds played. Then follow n lines, containing the information
about the rounds in "name score" format in chronological order, where
name is a string of lower-case Latin letters with the length from 1 to 32,
and score is an integer number between -1000 and 1000, inclusive.
Output:
Print the name of the winner.
4
SYSTEM REQUIREMENTS

 SOFTWARE REQUIREMENTS:
The major software requirements of the project are as follows:
Language : Turbo-C
Operating system: Windows Xp or later.

 HARDWARE REQUIREMENTS:
The hardware requirements that map towards the software are as follows:

RAM : 8 GB

Processor : intel core i3/i5


DATA FLOW DIAGRAM 5

5
ALGORITHM 6

Step1: start

Step2: read number of rounds played by players

Step3:using for loop, enter names of players and points

Step4:take base value equal to max=0.

4.1:if true, max=a[i]then i value increments

4.2:if false,max<a[i]then index place is equal to i

Step5:again goes to loop

Step6:print winner of game

Step7:stop
IMPLEMENTATION 7
#include<stdio.h>

int main()

int a[1024],i,n,max=0,f;

printf("enter the no of rounds:");

scanf("%d",&n);

char array[n][100];

for(i=0;i<n-1;i++)

printf("enter the player name:");

scanf("%s\n",array[i]);

printf("enter the player name:");

scanf("%d\n",&a[i]);

if(i==0)

max=a[0];

}else if(max<a[i])

max= a[i];

f=i;

}
}printf("%s\n",array[f]); 8

return 0;

}
Sample output 9
10
CONCLUSION
We completed our project “GAME WINNER” in allotted time. We
successfully completed our project with team work, we divided our project
into parts & completed it successfully without any errors under the supervision
of D.ANAND sir.

You might also like