0% found this document useful (0 votes)
174 views

CTSD Project Final2

The document describes a project report submitted by 4 students for their Computational Thinking for Structured Design course. It includes a cover page with their names and student IDs, as well as sections on acknowledgements, abstract, index, and introduction describing 2D arrays and their advantages. The aim is to find the maximum sum of an "hourglass" within a 2D array. The implementation section includes C code to define a 2D array, calculate the hourglass sums, and return the maximum. Testing outputs are shown confirming it works correctly.

Uploaded by

majji janardhan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
174 views

CTSD Project Final2

The document describes a project report submitted by 4 students for their Computational Thinking for Structured Design course. It includes a cover page with their names and student IDs, as well as sections on acknowledgements, abstract, index, and introduction describing 2D arrays and their advantages. The aim is to find the maximum sum of an "hourglass" within a 2D array. The implementation section includes C code to define a 2D array, calculate the hourglass sums, and return the maximum. Testing outputs are shown confirming it works correctly.

Uploaded by

majji janardhan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 16

K L UNIVERSITY

FRESHMAN ENGINEERING DEPARTMENT


Department of BES-1
A Project Based Lab Report

On

<TITLE>

SUBMITTED BY:

I.D NUMBER NAME

2100032124 VVN.Sainath

2100032125 T.Sairam

2100032151 V.Rohith

2100032129 Koushik

UNDER THE ESTEEMED GUIDANCE OF

Mr.NAGARAJ

ASST.PROF CTSD

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


“HOUR GLASS BY 2D ARRAY” submitted by Mr.VVN.Sainath bearing Regd. No.
2100032124 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 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 2021 – 2022.

PROJECT SUPERVISOR HEAD OF THE DEPARTMENT

< GUIDE NAME> 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 Director Dr. A. Jagdeesh for his
administration towards our academic growth.

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 <name> 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: VVN.Sainath

Regd . No: 2100032124.


ABSTRACT

Two-Dimensional Arrays • Arrays that we


have consider up to now are onedimensional
arrays, a single line of elements. • Often data
come naturally in the form of a table, e.g.,
spreadsheet, which need a two-dimensional
array.
INDEX
S.NO TITLE PAGE NO
1 Introduction <pageno>
2 Aim of the Project <pageno>
2.1 Advantages & Disadvantages <pageno>
2.2 Future Implementation <pageno>
3 Software & Hardware Details <pageno>
4 Data Flow Diagram <pageno>
5 Implementation <pageno>
6 Algorithm for each module <pageno>
7 Integration and System Testing <pageno>
8 Conclusion <pageno>

INTRODUCTION

2D ARRAY: 2D array can be defined as an array of


arrays. The 2D array is organized as matrices which
can be represented as the collection of rows and
columns. However, 2D arrays are created to implement
a relational database look alike data structre

The two dimensional (2D) array in C programming is


also known as matrix. A matrix can be represented as
a table of rows and columns.

Advantages of Arrays:

 Arrays represent multiple data items of the same


type using a single name.
 In arrays, the elements can be accessed randomly
by using the index number.
 Arrays allocate memory in contiguous memory
locations for all its elements.
AIM

Advantages of Arrays
 Arrays represent multiple data items of the same type
using a single name.
 In arrays, the elements can be accessed randomly by
using the index number.
 Arrays allocate memory in contiguous memory
locations for all its elements. Hence there is no chance
of extra memory being allocated in case of arrays. This
avoids memory overflow or shortage of memory in
arrays.
 Using arrays, other data structures like linked lists,
stacks, queues, trees, graphs etc can be implemented.
 Two-dimensional arrays are used to represent matrices

 Disadvantages:- The number of elements to be


stored in an array should be known in advance.
 An array is a static structure (which means the array is
of fixed size). Once declared the size of the array
cannot be modified. The memory which is allocated to
it cannot be increased or decreased.
 Insertion and deletion are quite difficult in an array as
the elements are stored in consecutive memory
locations and the shifting operation is costly.
 Allocating more memory than the requirement leads to
wastage of memory space and less allocation of
memory also leads to a problem.

Future enhancements:-

1) Array stores data elements of the same data type. 3) Arrays


can be used for sorting data elements. Different sorting
techniques like Bubble sort, Insertion sort, Selection sort etc
use arrays to store and sort elements easily.

2) Arrays can be used for performing matrix


operations. Many databases, small and large, consist of one-
dimensional and two-dimensional arrays whose elements
are records.

3) Arrays can be used for CPU scheduling. 


SYSTEM REQUIREMENTS

 SOFTWARE REQUIREMENTS:
The major software requirements of the project are as follows:

Language :C language

Operating system: dev c++

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

RAM :

Processor :
DATA FLOW DIAGRAM
ALGORITHM

Step1:start Step1:start
Step2:declare and read Step2: declare and read
the values the array
Step3: Step3:
STEP4:transefer the Step4: print the result
elements to fuction call
Step5: stop Step5:stop
IMPLEMENTATION

#include <stdio.h>
  

#define R 5
#define C 5
  
int MaxSum(int arr[R][C])
{
    int i, j, sum;
    if (R < 3 || C < 3)
        return -1;
  
    int max_sum
        = -500000;  
    
  

    for (i = 0; i < R - 2; i++) {


        for (j = 0; j < C - 2; j++) {
          
            sum = (arr[i][j] + arr[i][j + 1]
                   + arr[i][j + 2])
                  + (arr[i + 1][j + 1])
                  + (arr[i + 2][j] + arr[i + 2][j + 1]
                     + arr[i + 2][j + 2]);
  
      
            if (sum > max_sum)
                max_sum = sum;
             else
          continue;
        } else
    }
    return max_sum;
}
  
int main()
{
    int arr[][C] = { { 1, 2, 3, 0, 0 },
                     { 0, 0, 0, 0, 0 },
                     { 2, 1, 4, 0, 0 },
                     { 0, 0, 0, 0, 0 },
                     { 1, 1, 0, 1, 0 } };
  
   int res = MaxSum(arr);
  if (res == -1)
        printf (“not possible”);
     else
        printf (“maximum sum of hour glass =%d”, res);
    Return 0:

}
INTEGRATION AND SYSTEM TESTING
OUTPUTS
Screen Shots:
CONCLUSION

A two dimensional array is a set of single dimensional


arrays of same size and type allocated in adjacent
memory allocations. For our convenient a two
dimensional array is also defined as a table of data of
same type arranged in rows and columns.

You might also like