100% found this document useful (2 votes)
910 views14 pages

Prison Transfer

The document is a project report submitted by four students to their professor at KL University. It details the development of a program to calculate the number of possible ways to choose c prisoners to transfer to another city out of a total of n prisoners, based on the severity of their crimes represented by numbers on their chests. The prisoners chosen must have severity numbers less than an input value t and in contiguous order. The report includes an introduction, aim, advantages and disadvantages, software and hardware requirements, algorithm, flowchart, implementation, results, and conclusion sections. It was certified by the professor and department head that it fulfills the requirements for the students' computational thinking course.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (2 votes)
910 views14 pages

Prison Transfer

The document is a project report submitted by four students to their professor at KL University. It details the development of a program to calculate the number of possible ways to choose c prisoners to transfer to another city out of a total of n prisoners, based on the severity of their crimes represented by numbers on their chests. The prisoners chosen must have severity numbers less than an input value t and in contiguous order. The report includes an introduction, aim, advantages and disadvantages, software and hardware requirements, algorithm, flowchart, implementation, results, and conclusion sections. It was certified by the professor and department head that it fulfills the requirements for the students' computational thinking course.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 14

Koneru Lakshmaiah Education Foundation

(Deemed to be University)

FRESHMAN ENGINEERING DEPARTMENT


A Project Based Lab Report

On

PRISION TRANSFER

SUBMITTED BY:

I.D NUMBER STUDENT NAME

2200030624 G. SUDHEER

2200030625 R. K. S. NIHAR

2200030627 D. SHAMEER BASHA

2200030669 K. SHANUKESH

UNDER THE GUIDANCE OF

RAJESHN KUMAR ESWARAN

Assistant professor

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

CERTIFICATE

This is to certify that the project based laboratory report entitled

“PRISION TRASFER” submitted by Mr. G. SUDHEER, Mr. R. K. S. NIHAR, Mr. D.

SHAMEERBASHA ,Mr. K. SHANUMUKESH bearing Regd. No. 2200030624

,2200030625 ,2200030627 ,2200030669 to the Department of Basic

Engineering Sciences-1, KL University in partial fulfillment of the requirements

for the completion of a project based Laboratory in “COMPUTATIONAL THINKING

FOR STRUCTURED DESIGN”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

2022 – 2023.

PROJECT SUPERVISOR HEAD OF THE DEPARTMENT

Mr. E RAJESH KUMAR 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 the sincere gratitude to our principal Dr. A. Jagadeesh for his
administration towards our academic growth.

I express sincere gratitude to HOD-BES-1 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 RAJESH KUMAR


ESWARAN 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.

ID. No NAME

2200030624 G. SUDHEER

2200030625 R. K. S. NIHAR

2200030627 D. SHAMEER BASHA

2200030669 K. SHANUKESH
ABSTRACT

Here the question is transfer c prisoners to another city. We have to select


the prisoners to shift them. Each prisoner has a number on their chest. This
number reflects the severity of their crime .If the severity number is high then the
crime is more high. Mayor selected c prisoners based on their severity number
which should be less than severity number t. This t is represented for no risk at
the time of transfer. The severity number should be in contiguous order. Our task
is to find the number of possible ways to choose the c prisoners.From question, the
input consist of total number of prisoners n. The number of prisoners shifted to
other city and the severity number t .

We can read the severity number of each prisoner using array concept. The
index of an array starts from zero and it should be less than the total number of
prisoners. Loops concept is used to read the crime severity number by initializing
the value of I as zero. The condition is i should be less than n. It is increased by one.
Each time we are going to read the value in array of index i.Crime severity number
should always be greater than zero. It can not be a negative number. The output
consist of single variable which refers to the number of ways to choose the
prisoners.
INDEX

S.NO TITLE PAGE NO

1 Introduction 6

2 Aim of the Project 7

2.1 Advantages & Disadvantages 7

2.2 Future Implementation 7

3 Software & Hardware Details 8

4 Algorithm 9

5 Flowchart 10

6 Implementation 11,12

7 Results and Screenshots 13

8 Conclusion 14
INTRODUCTION
C was originally developed at Bell Labs by Dennis Ritchie between 1972
and 1973 to make utilities running on Unix. Later, it was applied to re-
implementing the kernel of the Unix operating system. During the 1980’s, C
gradually gained popularity. Nowadays, it is one of the most widely used
programming languages, with C compilers from various vendors available for the
majority of existing computer architectures and operating systems. C has been
standardized by the ANSI since 1989 (see ANSI C) and by the International
Organization for Standardization.

C is an imperative procedural language. It was designed to be


compiled using a relatively straight forward compiler to provide low-level access
to memory and language constructs that map efficiently to machine
instructions, all the minimal runtime support. Despite its low-level capabilities,
the language was designed to encourage cross-platform programming. A
standards-compliant C program written with potability in mind can be compiled
for a wide variety of computer platforms and operating systems with few
changes to its source code. The language is available on various platforms, from
embedded microcontrollers to supercomputers.

C language always is popular now during programming industry


meanwhile C++, Java languages are also in the top 3 as well as the C language.
By this time let us discuss about its advantages and disadvantages. Every code
or programming language own its advantage, at the same time along with its
development and optimization its disadvantages and in-adaptability will
embody. At the beginning, let us discuss its advantages, then subsequently it is
about the disadvantages of the C language.
AIM
An array is defined as the collection of similar type of data items stored at
contiguous memory location

Advantages:-

It is better and convenient way of storing the data of same datatype


with same size.It allows us to store known number of elements in it.It
allocates memory in contiguous memory locations for its elements. It does
not allocate any extra space/ memory for its elements. Hence there is no
memory overflow or shortage of memory in arrays.Iterating the arrays using
their index is faster compared to any other methods like linked list etc.

Disadvantages:-
It allows us to enter only fixed number of elements into it. We
cannot alter the size of the array once array is declared. Hence if we need to
insert more number of records than declared then it is not possible. We
should know array size at the compile time itself. Inserting and deleting the
records from the array would be costly since we add / delete the elements
from the array, we need to manage memory space too.It does not verify the
indexes while compiling the array. In case there is any indexes pointed which
is more than the dimension specified, then we will get run time errors rather
than identifying them at compile time.

Future enhancements:-

This program can be further made easy using other computer languages.
SYSTEM REQUIREMENTS

➢ SOFTWARE REQUIREMENTS:

The major software requirements of the project are as follows:

Language : C

Operating system: Windows X p or later.

➢ HARDWARE REQUIREMENTS:

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

RAM :8GB

Processor :INTEL CORE i5


ALGORITHM

Algorithm for main method:

STEP 1: Start.

STEP 2: Declare variables n, t, c, ans, i.

STEP 3: Read n, t, c.

STEP 4: Declare arr[n].

STEP 5: Read array elements arr.

STEP 6: Ans=Prison Transfer(n, t, c, arr).

STEP 7: Print(“The number of ways to choose the c prisonors =%d”,ans).

STEP 8: Stop.

Algorithm for Method Prison Transfer:

STEP 1: Start.

STEP 2: Declare i,j,k,cnt.

STEP 3: cnt=0.

STEP 4: for(i=c;i<=n;i++){

STEP 5: cnt++;

STEP 6: for(j=0;j<n;j++){

STEP 7: if(arr[i-j]>t) {

STEP 8: cnt;
FLOWCHART
IMPLEMENTATION

#include<stdio.h>

int PrisonTransfer(int n,int t,int c,int *arr )

int i,j,k;

int cnt=0;

for(i=c;i<=n;i++)

cnt++;

for(j=0;j<c;j++)

if(arr[i-j]>t)

cnt;

break;

return cnt;

}
int main()

int n,t,c,ans,i;

printf("Enter the total number of prisonors &crime severity &number of


prisonors shifted:");

scanf("%d%d%d",&n,&t,&c);

int arr[n];

printf("Enter the crime severities of prisoners:");

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

scanf("%d",&arr[i]);

ans=PrisonTransfer(n,t,c,arr);

printf("The number of ways to choose the c prisonors=%d\n",ans);

return 0;
RESULTS AND SCREENSHOTS

OUTPUTS

Screen Shots:

Output -1:

Output – 2:

Output – 3:
CONCLUSION
An array can be of any type, For example: int, float ,char etc. .Syntax: datatype
array_name[SIZE] datatype: It denotes the type of the elements in the array.
ARRAY_NAME: Name of the array. It must be a valid identifier. We conclude
that we should find the number of ways to find c number of prisoners using arrays.
We can further do this problem in other languages such ass c , cpp, python.

You might also like