0% found this document useful (0 votes)
20 views52 pages

ACLAB

Uploaded by

Kiran Kumar M
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
0% found this document useful (0 votes)
20 views52 pages

ACLAB

Uploaded by

Kiran Kumar M
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/ 52

Advanced Computing Lab

Experiment 1:

Aim: Start Raspberry Pi and try various Linux commands in command terminal window: ls,
cd, touch, mv, rm, man, mkdir, rmdir, tar, gzip, cat, more, less, ps, sudo, cron, chown, chgrp,
ping etc.

Most Basic and Commonly Used Raspberry Pi Commands

Each command can do a lot more of what I have shown here. To check out what more it can
do, try “–help” after the command.

File System

1. PWD (Print Working Directory)


This tells you your current working directory.

2. CD (Change Directory)
This commands is used to move to other directory. If you are on home and you want
to move to pictures folders which is in Desktop folder, then you should do as shown
below.

I M.Tech I Semester / Dept. of CSE, BIET(Autonomous)


1
Advanced Computing Lab

If you want to move back a directory, then write “cd ..” and to go to the home directory,
just write “cd”

3. LS (list)
This command lists the content of the current working

4. directoryThis command when used with “-l” will list the files and folders in the
current directory along with the file size, date modified and permissions.

Try “ls –help” and have a look at the other options.


5. MKDIR (Make Directory)
This command is used to make a new directory.

6. RMDIR (Remove Directory)


This command is used to remove an empty directory.

I M.Tech I Semester / Dept. of CSE, BIET(Autonomous)


2
Advanced Computing Lab

7. RM (Remove)
If you want to remove a file (Both empty and not empty), then use this command. If
used with –r will remove the file or even folder permanently.

8. Touch
If you want to create a new file, then use this command.

9. NANO
If you want to edit the file, then use this command.

10. CP (Copy)
This command is used to copy a file or a folder from one location to the other.

If you want to copy the whole folder, then use it with “-r”.

11. MV (Move)
This command will cut the file or folder from one location and will paste it to the
other location.

I M.Tech I Semester / Dept. of CSE, BIET(Autonomous)


3
Advanced Computing Lab

To cut and paste a file, follow the below image.

If you want to cut and paste the folder. The folder must be empty.

Networking Commands

1. Ping
This command is used to check that whether communication can be made with
another host or not.

2. Nmap
This command is used for network exploration and scanning. It can return port and
OS information about a host or a range of hosts. Type “nmap” to check out what it
can do.

I M.Tech I Semester / Dept. of CSE, BIET(Autonomous)


4
Advanced Computing Lab

3. Hostname
This command tells you your hostname

4. Ifconfig
This command will tell you the network configuration details such as your IP address.

5. Iwconfig
This command is used to check which network you are using. It will tell the network
name and its details.

6. Iwlist wlan0 scan


This command will print the currently available wireless networks.

I M.Tech I Semester / Dept. of CSE, BIET(Autonomous)


5
Advanced Computing Lab

General Commands

1. Sudo
This command allows you to run a command as a superuser or another user. Simply
type “sudo” to check what it can do.

2. Apt-get
This command is used to install, upgrade and remove the packages. Simply type “apt-
get” to check what it can do.

3. Find
This command is used to find the files or directories.

I M.Tech I Semester / Dept. of CSE, BIET(Autonomous)


6
Advanced Computing Lab

4. Raspi-config
This command will open the configuration settings menu.

5. Startx
This command will open the Graphical User Interface.

6. Reboot
This command will reboot the system immediately.

7. Shutdown
To shutdown now

To shutdown at specific time

I M.Tech I Semester / Dept. of CSE, BIET(Autonomous)


7
Advanced Computing Lab

Experiment 2:
Aim: Study and install IDE of Arduino and different types of Arduino
In this section, we will learn in easy steps, how to set up the Arduino IDE on our computer
and prepare the board to receive the program via USB cable.
Step 1 − First you must have your Arduino board (you can choose your favorite board) and
a USB cable. In case you use Arduino UNO, Arduino Duemilanove, Nano, Arduino Mega
2560, or Diecimila, you will need a standard USB cable (A plug to B plug), the kind you
would connect to a USB printer as shown in the following image.

In case you use Arduino Nano, you will need an A to Mini-B cable instead as shown in the
following image.

Step 2 − Download Arduino IDE Software.


You can get different versions of Arduino IDE from the Download page on the Arduino
Official website. You must select your software, which is compatible with your operating
system (Windows, IOS, or Linux). After your file download is complete, unzip the file.

I M.Tech I Semester / Dept. of CSE, BIET(Autonomous)


8
Advanced Computing Lab

Step 3 − Power up your board.


The Arduino Uno, Mega, Duemilanove and Arduino Nano automatically draw power from
either, the USB connection to the computer or an external power supply. If you are using an
Arduino Diecimila, you have to make sure that the board is configured to draw power from
the USB connection. The power source is selected with a jumper, a small piece of plastic
that fits onto two of the three pins between the USB and power jacks. Check that it is on the
two pins closest to the USB port.
Connect the Arduino board to your computer using the USB cable. The green power LED
(labeled PWR) should glow.
Step 4 − Launch Arduino IDE.
After your Arduino IDE software is downloaded, you need to unzip the folder. Inside the
folder, you can find the application icon with an infinity label (application.exe). Double-
click the icon to start the IDE.

I M.Tech I Semester / Dept. of CSE, BIET(Autonomous)


9
Advanced Computing Lab

Step 5 − Open your first project.


Once the software starts, you have two options −

 Create a new project.


 Open an existing project example.
To create a new project, select File → New.

To open an existing project example, select File → Example → Basics → Blink.

I M.Tech I Semester / Dept. of CSE, BIET(Autonomous)


10
Advanced Computing Lab

Here, we are selecting just one of the examples with the name Blink. It turns the LED on
and off with some time delay. You can select any other example from the list.
Step 6 − Select your Arduino board.
To avoid any error while uploading your program to the board, you must select the correct
Arduino board name, which matches with the board connected to your computer.
Go to Tools → Board and select your board.

I M.Tech I Semester / Dept. of CSE, BIET(Autonomous)


11
Advanced Computing Lab

Here, we have selected Arduino Uno board according to our tutorial, but you must select the
name matching the board that you are using.
Step 7 − Select your serial port.
Select the serial device of the Arduino board. Go to Tools → Serial Port menu. This is
likely to be COM3 or higher (COM1 and COM2 are usually reserved for hardware serial
ports). To find out, you can disconnect your Arduino board and re-open the menu, the entry
that disappears should be of the Arduino board. Reconnect the board and select that serial
port.

I M.Tech I Semester / Dept. of CSE, BIET(Autonomous)


12
Advanced Computing Lab

Step 8 − Upload the program to your board.


Before explaining how we can upload our program to the board, we must demonstrate the
function of each symbol appearing in the Arduino IDE toolbar.

A − Used to check if there is any compilation error.


B − Used to upload a program to the Arduino board.

I M.Tech I Semester / Dept. of CSE, BIET(Autonomous)


13
Advanced Computing Lab

C − Shortcut used to create a new sketch.


D − Used to directly open one of the example sketch.
E − Used to save your sketch.
F − Serial monitor used to receive serial data from the board and send the serial data to the
board.
Now, simply click the "Upload" button in the environment. Wait a few seconds; you will see
the RX and TX LEDs on the board, flashing. If the upload is successful, the message "Done
uploading" will appear in the status bar.

I M.Tech I Semester / Dept. of CSE, BIET(Autonomous)


14
Advanced Computing Lab

Aim: Study and Implement Zigbee Protocol using Arduino/RasberryPi

Zigbee Communication using RasberryPi

ZigBee is a communication device used for the data transfer between the controllers,
computers, systems, really anything with a serial port. As it works with low power
consumption, the transmission distances is limited to 10–100 meters line-of-sight. ZigBee
devices can transmit data over long distances by passing data through a mesh network of
intermediate devices to reach more distant ones. ZigBee is typically used in low data rate
applications that require long battery life and secure networking. Its main applications are in
the field of wireless sensor network based on industries as it requires short-range low-rate
wireless data transfer. The technology defined by the ZigBee specification is intended to be
simpler and less expensive than other wireless networks.

Here we make use of an interface of Zigbee with Raspberry Pi2 for a proper wireless
communication. Raspberry Pi2 has got four USB ports, so it is better to use a Zigbee Dongle
for this interface. Now we want to check the communication between the two paired ZigBee
modules.

Modules Needed:

1. Raspberry Pi2
2. XBee 1mW Wire Antenna- Series 1 (2 No:)

3. XBee Explorer Dongle (2 No:)

I M.Tech I Semester / Dept. of CSE, BIET(Autonomous)


15
Advanced Computing Lab

The two Zigbee must be paired with the same baudrate (for Ex: 9600) with X-CTU
Software. Attach the two Zigbee’s to the two dongle’s and connect one pair on the USB port
of the Raspberry Pi2. Connect the other pair to the USB port of a computer or a
Laptop. Install the FTDI Driver on the Computer /laptop to provide usb communication.
Create a hyperterminal, select the corresponding com port and the baudrate for the connected
device.
Click here to see the instructions to Test your XBee Explorer Dongle with PC.
In the Raspberry Pi2 section open the LX terminal and type lsusb.

I M.Tech I Semester / Dept. of CSE, BIET(Autonomous)


16
Advanced Computing Lab

The response showed inside a red box indicates the presence of a usb device in the module.
Write a python script to perform Zigbee communication which is given below.

import serial

# Enable USB Communication


ser = serial.Serial('/dev/ttyUSB0', 9600,timeout=.5)

while True:
ser.write('Hello User \r\n') # write a Data
incoming = ser.readline().strip()
print 'Received Data : '+ incoming

The two zigbee must be in a line of sight and check the results in the Python shell and in the
hyperterminal of the computer.

I M.Tech I Semester / Dept. of CSE, BIET(Autonomous)


17
Advanced Computing Lab

I M.Tech I Semester / Dept. of CSE, BIET(Autonomous)


18
Advanced Computing Lab

Experiment – 4:

Aim: Write a map reduce program that mines weather data. Weather sensors collecting data
every hour at many locations across the globe gather a large volume of log data, which is a
good candidate for analysis with Map Reduce, since it is semi structured and record-oriented.
Introduction:
 MapReduce is a programming model for data processing.

 Hadoop can run MapReduce programs written in various languages such as Java,
Ruby, Python, and C++.

 MapReduce programs are inherently parallel, this means we can perform very large-
scale data analysis on commodity hardware.

 MapReduce comes into its own for large datasets, one of such dataset is a weather
data set, we will write a program that mines weather data

A Weather Dataset:
 Weather sensors collect data every hour at many locations across the globe and gather
a large volume of log data.

 This data is very much suitable for analysis with MapReduce because it is semi-
structured and record-oriented.

Data Format
 The data we will use is from the National Climatic Data Centre (NCDC).

 The data is stored using a line-oriented ASCII format, in which each line is a record.

Example 2-1 shows a sample line with some of the salient fields highlighted. The line has
been split into multiple lines to show each field; in the real file, fields are packed into one line
with no delimiters.

I M.Tech I Semester / Dept. of CSE, BIET(Autonomous)


19
Advanced Computing Lab

 Data files are organized by date and weather station. There is a directory for each year
from 1901 to 2001, each containing a gzipped file for each weather station with its
readings for that year.

 For example, here are the first entries for 1990:


% ls raw/1990 | head
010010-99999-1990.gz
010014-99999-1990.gz
010015-99999-1990.gz
010016-99999-1990.gz
010017-99999-1990.gz
010030-99999-1990.gz
010040-99999-1990.gz
010080-99999-1990.gz

I M.Tech I Semester / Dept. of CSE, BIET(Autonomous)


20
Advanced Computing Lab

010100-99999-1990.gz
010150-99999-1990.gz
 What’s the highest recorded global temperature for each year in the dataset? We will
try to answer this question by using UNIX file processing tools and then using
MapReduce to understand the performance baseline.
Analyzing the Data with Unix Tools
 The classic tool for processing line-oriented data is awk.

Example 2-2 is a small script to calculate the maximum temperature for each year.

 The script loops through the compressed year files, first printing the year, and then
processing each file using awk.
 The awk script extracts two fields from the data: the air temperature and the quality
code.
 The air temperature value is turned into an integer by adding 0. Next, a test is applied
to see whether the temperature is valid (the value 9999 signifies a missing value in the
NCDC dataset) and whether the quality code indicates that the reading is not suspect
or erroneous.
 If the reading is OK, the value is compared with the maximum value seen so far,
which is updated if a new maximum is found.
 The END block is executed after all the lines in the file have been processed, and it
prints the maximum value.

I M.Tech I Semester / Dept. of CSE, BIET(Autonomous)


21
Advanced Computing Lab

The temperature values in the source file are scaled by a factor of 10, so this works out as a
maximum temperature of 31.7°C for 1901 (there were very few readings at the beginning of
the century, so this is plausible). The complete run for the century took 42 minutes in one run
on a single EC2 High-CPU Extra Large Instance.

To speed up the processing, we need to run parts of the program in parallel. In theory, this is
straightforward: we could process different years in different processes, using all the
available hardware threads on a machine. There are a few problems with this, however.

First, dividing the work into equal-size pieces isn’t always easy or obvious. In this case, the
file size for different years varies widely, so some processes will finish much earlier than
others. Even if they pick up further work, the whole run is dominated by the longest file. A
better approach, although one that requires more work, is to split the input into fixed-size
chunks and assign each chunk to a process.

Second, combining the results from independent processes may need further processing. In
this case, the result for each year is independent of other years and may be combined by
concatenating all the results, and sorting by year. If using the fixed-size chunk approach, the
combination is more delicate. For this example, data for a particular year will typically be
split into several chunks, each processed independently. We’ll end up with the maximum
temperature for each chunk, so the final step is to look for the highest of these maximums, for
each year.

Third, you are still limited by the processing capacity of a single machine.

I M.Tech I Semester / Dept. of CSE, BIET(Autonomous)


22
Advanced Computing Lab

Aim: Write a program to implement Bankers algorithm for Dead Lock Avoidance.

Description:

Banker’s Algorithm is a resource allocation and deadlock avoidance algorithm. This


algorithm test for safety simulating the allocation for predetermined maximum possible
amounts of all resources, then makes an “s-state” check to test for possible activities, before
deciding whether allocation should be allowed to continue.
In simple terms, it checks if allocation of any resource will lead to deadlock or not,
OR is it safe to allocate a resource to a process and if not then resource is not allocated to that
process. Determining a safe sequence(even if there is only 1) will assure that system will not
go into deadlock.
Banker’s algorithm is generally used to find if a safe sequence exist or not. But here
we will determine the total number of safe sequences and print all safe sequences.
Program:

#include<stdio.h>
void main()
{
int n,r,i,j,k,p,u=0,s=0,m;
int block[10],run[10],active[10],newreq[10];
int max[10][10],resalloc[10][10],resreq[10][10];
int totalloc[10],totext[10],simalloc[10];
printf("Enter the no of processes:");
scanf("%d",&n);
printf("Enter the no ofresource classes:");
scanf("%d",&r);
printf("Enter the total existed resource in each class:");
for(k=1; k<=r; k++)
scanf("%d",&totext[k]);
printf("Enter the allocated resources:");
for(i=1; i<=n; i++)
for(k=1; k<=r; k++)
scanf("%d",&resalloc);
printf("Enter the process making the new request:");
scanf("%d",&p);
printf("Enter the requested resource:");

I M.Tech I Semester / Dept. of CSE, BIET(Autonomous)


23
Advanced Computing Lab

for(k=1; k<=r; k++)


scanf("%d",&newreq[k]);
printf("Enter the process which are n blocked or running:");
for(i=1; i<=n; i++)
{
if(i!=p)
{
printf("process %d:\n",i+1);
scanf("%d%d",&block[i],&run[i]);
}
}
block[p]=0;
run[p]=0;
for(k=1; k<=r; k++)
{
j=0;
for(i=1; i<=n; i++)
{
totalloc[k]=j+resalloc[i][k];
j=totalloc[k];
}
}
for(i=1; i<=n; i++)
{
if(block[i]==1||run[i]==1)
active[i]=1;
else
active[i]=0;
}
for(k=1; k<=r; k++)
{
resalloc[p][k]+=newreq[k];
totalloc[k]+=newreq[k];
}

I M.Tech I Semester / Dept. of CSE, BIET(Autonomous)


24
Advanced Computing Lab

for(k=1; k<=r; k++)


{
if(totext[k]-totalloc[k]<0)
{
u=1;
break;
}
}
if(u==0)
{
for(k=1; k<=r; k++)
simalloc[k]=totalloc[k];
for(s=1; s<=n; s++)
for(i=1; i<=n; i++)
{
if(active[i]==1)
{
j=0;
for(k=1; k<=r; k++)
{
if((totext[k]-simalloc[k])<(max[i][k]-resalloc[i][k]))
{
j=1;
break;
}
}
}
if(j==0)

{
active[i]=0;
for(k=1; k<=r; k++)
simalloc[k]=resalloc[i][k];
}

I M.Tech I Semester / Dept. of CSE, BIET(Autonomous)


25
Advanced Computing Lab

}
m=0;
for(k=1; k<=r; k++)
resreq[p][k]=newreq[k];
printf("Deadlock willn't occur");
}
else
{
for(k=1; k<=r; k++)
{
resalloc[p][k]=newreq[k];
totalloc[k]=newreq[k];
}
printf("Deadlock will occur");
}

Aim: Write a program to Producer Consumer problem using semaphores.

I M.Tech I Semester / Dept. of CSE, BIET(Autonomous)


26
Advanced Computing Lab

Description: The producer consumer problem is a synchronization problem. There is a fixed


size buffer and the producer produces items and enters them into the buffer. The consumer
removes the items from the buffer and consumes them.
A producer should not produce items into the buffer when the consumer is consuming
an item from the buffer and vice versa. So the buffer should only be accessed by the producer
or consumer at a time. The producer consumer problem can be resolved using semaphores.
Producer Process
The code that defines the producer process is given below:
do{
producer item
wait(empty);
wait(mutex);
PUT ITEM IN BUFFER
signal(mutex);
Signal(full);
} while(1)
In the above code, mutex, empty and full are semaphores. Here mutex is initialized to 1,
empty is initialized to n (maximum size of the buffer) and full is initialized to 0.
Consumer Process
The code that defines the consumer process is given below:
do {
wait (full);
wait (mutex);
REMOVE ITEM FROM BUFFER
signal (mutex);
signal (empty);
CONSUME ITEM
} while(1);
The wait operation is carried out on full. This indicates that items in the buffer have
decreased by 1. Then wait operation is carried out on mutex so that producer process cannot
interfere.
Program:
#include<stdio.h>
#include<stdlib.h>

int mutex=1,full=0,empty=3,x=0;

I M.Tech I Semester / Dept. of CSE, BIET(Autonomous)


27
Advanced Computing Lab

int main()
{
int n;
void producer();
void consumer();
int wait(int);
int signal(int);
printf("\n1.Producer\n2.Consumer\n3.Exit");
while(1)
{
printf("\nEnter your choice:");
scanf("%d",&n);
switch(n)
{
case 1: if((mutex==1)&&(empty!=0))
producer();
else
printf("Buffer is full!!");
break;
case 2: if((mutex==1)&&(full!=0))
consumer();
else
printf("Buffer is empty!!");
break;
case 3:
exit(0);
break;
}
}

return 0;
}

int wait(int s)
{
return (--s);
}

int signal(int s)
{
return(++s);
}

I M.Tech I Semester / Dept. of CSE, BIET(Autonomous)


28
Advanced Computing Lab

void producer()
{
mutex=wait(mutex);
full=signal(full);
empty=wait(empty);
x++;
printf("\nProducer produces the item %d",x);
mutex=signal(mutex);
}

void consumer()
{
mutex=wait(mutex);
full=wait(full);
empty=signal(empty);
printf("\nConsumer consumes item %d",x);
x--;
mutex=signal(mutex);
}

I M.Tech I Semester / Dept. of CSE, BIET(Autonomous)


29
Advanced Computing Lab

Aim: Write a Program of bit stuffing used by Data Link Layer.

Description:
Data link layer is responsible for something called Framing, which is the division of
stream of bits from network layer into manageable units (called frames). Frames could be of
fixed size or variable size. In variable-size framing, we need a way to define the end of the
frame and the beginning of the next frame.
Bit stuffing is the insertion of non information bits into data. Note that stuffed bits
should not be confused with overhead bits. Overhead bits are non-data bits that are necessary
for transmission (usually as part of headers, checksums etc.).

PROGRAM:
#include<stdio.h>
#include<string.h>

I M.Tech I Semester / Dept. of CSE, BIET(Autonomous)


30
Advanced Computing Lab

void main()
{
int a[20],b[30],i,j,k,count,n;
printf("Enter frame size:");
scanf("%d",&n);
printf("Enter the frame in the form of 0 and 1 :");
for(i=0; i<n; i++)
scanf("%d",&a[i]);
i=0;
count=1;
j=0;
while(i<n)
{
if(a[i]==1)
{
b[j]=a[i];
for(k=i+1; a[k]==1 && k<n && count<5; k++)
{
j++;
b[j]=a[k];
count++;
if(count==5)
{
j++;
b[j]=0;
}
i=k;
}
}
else
{
b[j]=a[i];
}
i++;

I M.Tech I Semester / Dept. of CSE, BIET(Autonomous)


31
Advanced Computing Lab

j++;
}
printf("After Bit Stuffing :");
for(i=0; i<j; i++)
printf("%d",b[i]);

I M.Tech I Semester / Dept. of CSE, BIET(Autonomous)


32
Advanced Computing Lab

Aim: Write a program to configure a Network using Distance Vector Routing Protocol.

A distance-vector routing protocol in data networks determines the best route for data packets
based on distance. Distance-vector routing protocols measure the distance by the number
of routers a packet has to pass, one router counts as one hop. Some distance-vector protocols
also take into account network latency and other factors that influence traffic on a given
route. To determine the best route across a network, routers, on which a distance-vector
protocol is implemented, exchange information with one another, usually routing tables plus
hop counts for destination networks and possibly other traffic information. Distance-vector
routing protocols also require that a router informs its neighbours of network
topology changes periodically.

PROGRAM:

#include<stdio.h>

struct node

unsigned dist[20];

unsigned from[20];

}rt[10];

int main()

int dmat[20][20];

int n,i,j,k,count=0;

printf("\nEnter the number of nodes : ");

scanf("%d",&n);

printf("\nEnter the cost matrix :\n");

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

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

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

dmat[i][i]=0;

I M.Tech I Semester / Dept. of CSE, BIET(Autonomous)


33
Advanced Computing Lab

rt[i].dist[j]=dmat[i][j];

rt[i].from[j]=j;

do

count=0;

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

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

for(k=0;k<n;k++)

if(rt[i].dist[j]>dmat[i][k]+rt[k].dist[j])

rt[i].dist[j]=rt[i].dist[k]+rt[k].dist[j];

rt[i].from[j]=k;

count++;

}while(count!=0);

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

printf("\n\nState value for router %d is \n",i+1);

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

printf("\t\nnode %d via %d Distance%d",j+1,rt[i].from[j]+1,rt[i].dist[j]);

printf("\n\n");

I M.Tech I Semester / Dept. of CSE, BIET(Autonomous)


34
Advanced Computing Lab

Aim: To Draw ER Diagrams and DFD’s

ER Diagrams and DFD’s for Attendance Maintenance System

ER Diagram

The ER model defines the conceptual view of a database. It works around real-world entities
and the associations among them. At view level, the ER model is considered a good option
for designing

Entity
An entity can be a real-world object, either animate or inanimate, that can be easily
identifiable. For example, in a school database, students, teachers, classes, and courses
offered can be considered as entities. All these entities have some attributes or properties that
give them their identity.

Attributes
Entities are represented by means of their properties, called attributes. All attributes have
values. For example, a student entity may have name, class, and age as attributes.

There exists a domain or range of values that can be assigned to attributes. For example, a
student's name cannot be a numeric value. It has to be alphabetic. A student's age cannot be
negative.

Data Flow Diagram


Data flow diagram is graphical representation of flow of data in an information system. It is
capable of depicting incoming data flow, outgoing data flow and stored data. The DFD does
not mention anything about how data flows through the system.
There is a prominent difference between DFD and Flowchart. The flowchart depicts flow of
control in program modules. DFDs depict flow of data in the system at various levels. DFD
does not contain any control or branch elements.

Types of DFD
Data Flow Diagrams are either Logical or Physical.

I M.Tech I Semester / Dept. of CSE, BIET(Autonomous)


35
Advanced Computing Lab

 Logical DFD - This type of DFD concentrates on the system process, and flow of
data in the system.For example in a Banking software system, how data is moved
between different entities.
 Physical DFD - This type of DFD shows how the data flow is actually implemented
in the system. It is more specific and close to the implementation.

DFD Components

DFD can represent Source, destination, storage and flow of data using the following set of
components -

 Entities - Entities are source and destination of information data. Entities are
represented by a rectangles with their respective names.
 Process - Activities and action taken on the data are represented by Circle or Round-
edged rectangles.
 Data Storage - There are two variants of data storage - it can either be represented as
a rectangle with absence of both smaller sides or as an open-sided rectangle with only
one side missing.
 Data Flow - Movement of data is shown by pointed arrows. Data movement is shown
from the base of arrow as its source towards head of the arrow as destination.

I M.Tech I Semester / Dept. of CSE, BIET(Autonomous)


36
Advanced Computing Lab

Example: ER Diagram

Data flow diagrams

I M.Tech I Semester / Dept. of CSE, BIET(Autonomous)


37
Advanced Computing Lab

I M.Tech I Semester / Dept. of CSE, BIET(Autonomous)


38
Advanced Computing Lab

Aim: Write a program to perform the system analysis: Requirement analysis, SRS.

To Analyze requirements and Prepare SRS for Attendance Maintenance System

I M.Tech I Semester / Dept. of CSE, BIET(Autonomous)


39
Advanced Computing Lab

Software Requirements Specification for Attendance Maintenance System

Sample structure of SRS

1. Introduction
1.1 Purpose
1.2 Scope
1.3 Overview
2. General Description
2.1 User Manual
3. Functional Requirements
3.1 Description
3.2 Technical Issues
4. Interface Requirements
4.1 GUI
4.2 Hardware Interface
4.3 Software Interface
5. Performance Requirements
6. Design Constraints
7. Other Non functional Attributes
7.1 Security
7.2 Reliability
7.3 Availability
7.4 Maintainability
7.5 Reusability
8. Operational Scenarios
9. Preliminary Schedule

Example: SRS Document for Attendance Management System

1. Introduction

1.1 Purpose

I M.Tech I Semester / Dept. of CSE, BIET(Autonomous)


40
Advanced Computing Lab

This document detailed functional and non-functional requirements for attendance


maintenance system. The purpose of this document is that the requirements mentioned in it
should be utilized by software developer to implement the system.

1.2 Scope
This system allows the teacher to maintain attendance record of the classes to which it is
teaching. With the help of this system Teacher should be in a position to send e-mail to the
students who remain absent for the class. The system provides a cumulative report at every
month end for the corresponding class.

1.3 Overview

This system provides an easy solution to the teacher to keep track of student attendance, and
statistics.

2. General Description

This attendance maintenance system replaces the traditional, manual attendance system by
which a lot of paper work will be reduced. The teacher should able to view photograph of
student along with his attendance in his laptop. This is the primary feature of this system.
Another feature is that Teacher can be allowed to edit particular record at desired time. The
system should produce monthly attendance report. And there should be facility to send an e-
mail/warning to the student remaining absent in the class.

Every Teacher should have laptop with wireless internet connection. A teacher may teach to
different classes and a separate record for the corresponding classes should be maintained.

I M.Tech I Semester / Dept. of CSE, BIET(Autonomous)


41
Advanced Computing Lab

2.1 User manual:

The system should provide Help option in which how to operate the system should be
explained. Also hard copy of this document should be given to the user in a booklet form.

3. Functional Requirements:

The identity of student is verified and then marked present at particular date and time. The
system should display student photograph along with their names for the corresponding class.
The student may be marked present or absent students. A statistical report should display
individuals report or a cumulative report whenever required.

3.1 Description

The identity of student is verified and then marked present at particular date and time. The
system should display student photograph along with their names for that corresponding
class. The student may be marked present or absent depending upon his display individuals
report or a cumulative report whenever requirement.

3.2 Technical Issues

The system should be implemented in VC++.

4. Interface Requirements

4.1 GUI

GUI 1: Main menu should provide option such as File, Edit, Report, help.

GUI 2: In File menu one can create a new record file or can open an existing record file..

GUI 3: The display of record

GUI 4: Report option should display statistical report. It may be particular student or for the
whole class.

GUI 5: Help option should describe functionality of the system. It should be written in simple
HTML.

4.2 Hardware Interface

Hardware Interface 1: The system should be embedded in the laptops.

I M.Tech I Semester / Dept. of CSE, BIET(Autonomous)


42
Advanced Computing Lab

Hardware Interface 2: The laptop should use wireless EthernetCard to send departmental
database server.

4.3 Software Interface:

Software Interface 1: Attendance maintenance system.

Software Interface 2: The attendance database should be transmitted to departmental database


server.

Software Interface 3: E-mail message generator which generates standard message of


absence.

Software Interface 4: Report generators.

5. Performance Requirements

This system should work concurrently on multiple processors between college hours. The
system should support 50 users.

The email should be send within one hour after class gets over.

The system should support taking attendance of maximum 10 students per class.

6. Design Constraints

The system should be designed within 6 months.

7. Other Non Functional Attributes

7.1 Security

The teacher should provide password to log on to the system. He/she should be able to see the
record of his/her class.

7.2 Reliability

Due to wireless connectivity, reliability cannot be guaranteed.

7.3 Availability

The system should be available during college hours.

I M.Tech I Semester / Dept. of CSE, BIET(Autonomous)


43
Advanced Computing Lab

7.4 Maintainability

There should be a facility to add or delete or update teachers and students for each semester

7.5 Reusability

There should be a facility to add or delete or update teachers and students for each semester.

8. Operational Scenarios

There will be student database, teacher database. The student database will contain students
name, class, attendance, email address, address, and phone number.

The teacher database will contain teachers name, class taught, e-mail address, phone number.

9. Preliminary Schedule

The system has to be implemented within 6 months.

I M.Tech I Semester / Dept. of CSE, BIET(Autonomous)


44
Advanced Computing Lab

Aim: To Analyze the Risk involved and Prepare RMMM Plan

RMMM Planfor Attendance Maintenance System

TYPES OF RISKS INVOLVED

People risks are associated with the availability, skill level, and retention of the people on
the development team.

Size risks are associated with the magnitude of the product and the product team. Larger
products are generally more complex with more interactions. Larger teams are harder to
coordinate.

Process risks are related to whether the team uses a defined, appropriate software
development process and to whether the team members actually follow the process.

Technology risks are derived from the software or hardware technologies that are being used
as part of the system being developed. Using new or emerging or complex technology
increases the overall risk.

Tools risks, similar to technology risks, relate to the use, availability, and reliability of
support software used by the development team, such as development environments and
other Computer-Aided Software Engineering (CASE) tools.

Organizational and managerial risks are derived from the environment where the software
is being developed. Some examples are the financial stability of the company and threats of
company reorganization and the potential of the resultant loss of support by management due
to a change in focus or a change in people.

Customer risks are derived from changes to the customer requirements, customers’ lack of
understanding of the impact of these changes, the process of managing these requirements
changes, and the ability of the customer to communicate effectively with the team and to
accurately convey the attributes of the desired product.

Sales and support risks involve the chances that the team builds a product that the sales
force does not understand how to sell or that is difficult to correct, adapt, or enhance.

RMMM PLAN:
The RMMM plan is a document in which all the risk analysis activities are
described. Sometimes project manager includes this document as a part of overall project
plan. Sometimes specific RMMM Plan is not created, however each risk can be described
individually using risk information sheet.

I M.Tech I Semester / Dept. of CSE, BIET(Autonomous)


45
Advanced Computing Lab

Typical template for RMMM Plan.


Risk Information sheet

Project Name< Enter Name of the project for which risk has to be identified>

Risk id< # Date Probability Impact


> <date at which risk is <Risk Probability % <low/medium/high>
identified> >
Origin Assigned to
< The person who have identified the <Who is responsible for mitigating the
risk> risk>
Description
<Description of risk identified>
Refinement/Context
<Associated information for risk refinement>
Mitigation/ Monitoring
<Enter the mitigation / Monitoring steps taken>
Trigger/Contingency Plan
<if Risk Mitigation fails then the pan for handling the risk>
Status
<Running status that provides a history of what is being done for the risk and
changes in the risk. Include the date the status entry was made>
Approval Closing Date
< Name & Signature of person <Date>
approving closure>

Example: RMMM Plan for Attendance Maintenance system

Risk Information sheet

Project Name<Attendance Maintenance system>

Risk id<1> Date< 21/12/19> Probability<20 % > Impact


<medium>

Origin <K Surya> Assigned to <P Srikanth>

Description

<Summation of attendance is not working after each month>

Refinement/Context

<Update the software program and check for the summation function>

Mitigation/ Monitoring

I M.Tech I Semester / Dept. of CSE, BIET(Autonomous)


46
Advanced Computing Lab

<See that every module is in working condition or not>

Trigger/Contingency Plan

<Call the developer of the software and ask him/her to correct the module which
is not working properly>

Status

<1. Contacted the developer of the software purchased : 23/12/19

2 Attendance is taken manually till the module gets worked : 25/12/19


3 Developer corrects the module : 26/12/19>
Approval Closing Date

<Charan> <27/12/19>

I M.Tech I Semester / Dept. of CSE, BIET(Autonomous)


47
Advanced Computing Lab

Aim: Write a program to draw the structural view diagram: Class diagram, object diagram.

Class Diagram: A class diagram shows a set of classes, interfaces, and collaborations and
their relationships. Class diagrams that include active classes address the static process view
of a system.
In Railway reservation system the class diagram consists of passenger, Railway
officer, Enquiry officer, railway db, schedule and ticket classes. The ticket class is used to
explain the complete details about the tickets. It can be divided into book and cancel classes.
This can be represented by inheritance relationship. Passenger class contains the complete
details of the users. The enquiry officer class gives details of the trains to the passenger. The
schedule class contains the train timing class. The railway db maintains total system data.
This database contains total train and passenger details. In this database the older details are
also maintained. Every time the database is appended with the new data. All classes are
communicated by using association relationship. The role and multiplicity properties are
applied to all the classes. Every class is represented with the role. The passenger role is
enquires the enquiry officer about the trains. This can be represented by enquiry role name in
between the passenger and enquiry officer classes.

Object Diagram:
 Object diagrams represent static snapshots of instances of the things found in class
diagrams.

I M.Tech I Semester / Dept. of CSE, BIET(Autonomous)


48
Advanced Computing Lab

 These diagrams address the static design view or static process view of a system.
 An object diagram shows a set of objects and their relationships.
 An object diagram shows this relation between the instantiated classes and the defined
class, and the relation between these objects in the system.
 They are be useful to explain smaller portions of your system, when your system class
diagram is very complex, and also sometimes modeling recursive relationship in
diagram.

Class to Object Diagram Example - Order System

I M.Tech I Semester / Dept. of CSE, BIET(Autonomous)


49
Advanced Computing Lab

Write C programs for implementing the Demorgan’s law

#include <stdio.h>
#include <math.h>

// start main program.


int main()
{
// variables
int a;
int b;
int g;
int i;
int j;
int x;
int y;
char ch = 'y';

do {

puts("\nShow that (!(x < 5) && !(y >= 7)) and !((x < 5) || (y >= 7)) are logically
equivalent\n\n"); // Part a

// input x and y values


printf("%s", "Enter x: ");
scanf("%2u", &x);
printf("%s", "Enter y: ");
scanf("%2u", &y);

// if statement to handle logical equivalency


if ((!(x < 5) && !(y >= 7)) && !((x < 5) || (y >= 7))) {
printf("%s", "True!\n\n");
}
else {
printf("%s", "False!\n\n");
}

printf("%s", "Want more examples of this logical equivalency? ");


getchar();
scanf("%c", &ch);
}
while (ch == 'y'); // choose yes to continue with current part, or no to move on

if (ch == 'n') {

do {

I M.Tech I Semester / Dept. of CSE, BIET(Autonomous)


50
Advanced Computing Lab

puts("\nShow that (!(a == b) || !(g != 5)) and !((a == b) && (g != 5)) are logically
equivalent\n\n");

// input a, b, and g values


printf("%s", "Enter a: ");
scanf("%2u", &a);
printf("%s", "Enter b: ");
scanf("%2u", &b);
printf("%s", "Enter g: ");
scanf("%2u", &g);

// if statement to handle logical equivalency


if ((!(a == b) || !(g != 5)) && !((a == b) && (g != 5))) {
printf("%s", "True!\n\n");
}
else {
printf("%s", "False!\n\n");
}
printf("%s", "Want more examples of this logical equivalency? ");
getchar();
scanf("%c", &ch);
}
while(ch == 'y'); // choose yes to continue with current part, or no to move on
}

if (ch == 'n') {

do {
puts("\nShow that !((x <= 8) && (y > 4)) and (!(x <= 8) || !(y > 4)) are logically
equivalent\n\n");

// input x and y values


printf("%s", "Enter x: ");
scanf("%2u", &x);
printf("%s", "Enter y: ");
scanf("%2u", &y);

// if statement to handle logical equivalency


if (!((x <= 8) && (y > 4)) && (!(x <= 8) || !(y > 4))) {
printf("%s", "True!\n\n");
}
else {
printf("%s", "False!\n\n");
}
printf("%s", "Want more examples of this logical equivalency? ");
getchar();
scanf("%c", &ch);
}
while (ch == 'y'); // choose yes to continue with current part, or no to move on
}

I M.Tech I Semester / Dept. of CSE, BIET(Autonomous)


51
Advanced Computing Lab

if (ch == 'n') {

do {
puts("\nShow that !((i > 4) || (j <= 6)) and (!(i > 4) && !(j <= 6)) are logically
equivalent\n\n");

// input i and j values


printf("%s", "Enter i: ");
scanf("%2u", &i);
printf("%s", "Enter j: ");
scanf("%2u", &j);

// if statement to handle logical equivalency


if (!((i > 4) || (j <= 6)) && (!(x <= 8) && !(y > 4))) {
printf("%s", "True!\n\n");
}
else {
printf("%s", "False!\n\n");
}
printf("%s", "Want more examples of this logical equivalency? ");
getchar();
scanf("%c", &ch);
}
while (ch == 'y'); // choose yes to continue with current part, or no to move on
}

if (ch == 'n') {
printf("\n%s", "Now you know DeMorgan's Laws!");
}

system("pause");
return 0;
}

I M.Tech I Semester / Dept. of CSE, BIET(Autonomous)


52

You might also like