2023 2024 EduVark > Education Discussion > General Discussion


  #2  
February 16th, 2017, 09:20 AM
Unregistered
Guest User
 
Re: Anna University SS Lab Manual

Hii sir, I Wants to get the Lab Manual of the - System Software Lab of the Anna University ?
  #3  
February 16th, 2017, 09:22 AM
Super Moderator
 
Join Date: Mar 2012
Re: Anna University SS Lab Manual

Anna University is a technical university in Tamil Nadu, India. The main university campus is located in Guindy, Chennai. It was named after C N Annadurai, former Chief Minister of Tamil Nadu on 4 September 1978


the Lab Manuals of the System Software Lab of the Anna University is given below


Title of the Exercise : IMPLEMENTATION OF A SYMBOL TABLE

FACILITIES REQUIRED AND PROCEDURE

a) Facilities Required:
S.No. Facilities required Quantity
1 System 1
2 O/S Windows XP
3 S/W name C or C++


b) Procedure:

Details of the step
Initialize all the variables.
Design a menu through which we can create a symbol Table and
perform operations as insert, modify, search and display.
Create a symbol table with fields asvariable and value using create
option. Entries may be added to the table while it is created itself.
Append new contents to the symbol table with the constraint that there
s no duplication of entries, using insert option.
Modify existing content of the table using modify option.
Use display option to display the contents of the table.
End of the program.

c) Program:
#include<stdio.h> #include<conio.h> #include<stdlib.h> #include<string.h>
Struct table
{
char var[10]; int value;
};
struct table tb1[20];
int i,j,n; void create(); void modify();
int search(char variable[],int n); void insert(); void display();
void main()
{ int ch,result=0;
char v[10];
clrscr();
do
{
printf("\n\n1.CREATE\n2.INSERT\n3.MODIFY\n4.SEARCH \n5.DISPLAY\n6.EXIT:\t");
scanf("%d",&ch);


switch(ch)
{
case 1:create(); break;
case 2:insert(); break;
case 3:modify(); break;
case 4rintf("\nEnter the variable to be searched:");
scanf("%s",&v);
result=search(v,n);
if(result==0)
printf("\nThe variable is not present\n");
else
printf("\nThe location of the variableis %d \n The value of %
%d.",result,tb1[result].var,tb1[result].value);
break;
case 5:display(); break; case 6:exit(1);
}
}while(ch!=6);
getch();
}
void create()
{ printf("\nEnter the no. of entries:");
scanf("%d",&n);
printf("\nEnter the variable and the values:-\n");
for(i=1;i<=n;i++)
{ scanf("%s%d",tb1[i].var,&tb1[i].value);
check:
if(tb1[i].var[0]>='0' && tb1[i].var[0]<='9')
{ printf("\nVariable should start with alphabet\nEnter correct
scanf("%s%d",tb1[i].var,&tb1[i].value);
goto check;
}
check1:
for(j=1;j<i;j++)
{ if(strcmp(tb1[i].var,tb1[j].var)==0)
{ printf("\nThe variable already present. Enter another:");
scanf("%s%d",&tb1[i].var,&tb1[i].value);
goto check1;
} } }
printf("\nThe table after creation is:\n");
display();
}
void insert()
{
if(i>=20)
printf("\nCannot insert.table is full\n");
else
{
n++;

printf("\nEnter the variable and the value:");
scanf("%s%d",&tb1[n].var,&tb1[n].value);
check:
if(tb1[i].var[0]>='0' && tb1[i].var[0]<='9')
{
printf("\nVariable should start with alphabet\nEnter correct name\n");
scanf("%s%d",tb1[i].var,&tb1[i].value);
goto check;
}
check1:
for(j=1;j<n;j++)
{
if(strcmp(tb1[j].var,tb1[i].var)==0)
{
printf("\nThe variable already present. Enter another:");
scanf("%s%d",&tb1[i].var,&tb1[i].value);
goto check1;
}
}
printf("\nThe table after insertion is:");
display();
}
}
void modify()
{
char variable[10];
int result=0;
printf("\nEnter the variable to be modified:");
scanf("%s",&variable);
result=search(variable,n);
if(result==0)
printf("%s not present\n",variable);
else
{
printf("\nThe current value of the variable %s is %d.\nEnter the new variable and its
value",tb1[result].var,tb1[result].value);
scanf("%s%d",tb1[result].var,&tb1[result].value);
check:
if(tb1[i].var[0]>='0' && tb1[i].var[0]<='9')
{
printf("\nVariable should start with alphabet\nEnter correct name\n");
scanf("%s%d",tb1[i].var,&tb1[i].value);
goto check;
}
}
printf("\nThe table after modification is:");
display();
}

int search(char variable[],int n)
Dr.NNCE I T / V Sem SS Lab - LM
9
{
int flag;
for(i=1;i<=n;i++)
if(strcmp(tb1[i].var,variable)==0)
{
flag=1;
break;
}
if(flag==1)
return i;
else
return 0;
}
void display()
{
printf("\nVariable\tvalue\n");
for(i=1;i<=n;i++)
printf("%s\t\t%d\n",tb1[i].var,tb1[i].value);
}
d) Output:
1.CREATE
2.INSERT
3.MODIFY
4.SEARCH
5.DISPLAY
6.EXIT:1
Enter the no. of entries:2
Enter the variable and the values:-
a 23
c 45
The table after creation is:
Variable value
a 23
c 45
1.CREATE 2.INSERT 3.MODIFY 4.SEARCH 5.DISPLAY 6.EXIT:2
Enter the variable and the value:b 34
The table after insertion is:
Variable value
a 23
c 45
b 34
1.CREATE
2.INSERT
3.MODIFY
4.SEARCH
5.DISPLAY
6.EXIT: 3




Rest of the Lab Manuals of the System Software lab of Anna University is given in the below Attachement


For more details you may Contact to the Anna University the contact details Are given below

Contact details :
Anna University
Address: Sardar Patel Road, Guindy, Chennai, Tamil Nadu 600025
Phone: 044 2235 7004
Attached Files
File Type: pdf System Software lab of Anna University.pdf (229.7 KB, 202 views)


Quick Reply
Your Username: Click here to log in

Message:
Options



All times are GMT +5. The time now is 11:06 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Content Relevant URLs by vBSEO 3.6.0

1 2 3 4 5 6 7 8