web viewans: message switching: the source computer sends data message to the switching office,...

92
KENDRIYA VIDYALAYA SANGATHAN STUDY MATERIAL (Computer Science (083)) Class – XII (STUDY MATERIAL FOR LOW ACHIEVERS) 2016-17

Upload: dokien

Post on 06-Feb-2018

216 views

Category:

Documents


2 download

TRANSCRIPT

Page 1: Web viewAns: Message switching: The source computer sends data message to the switching office, which stores data in abuffer.It then looks for a free link to

KENDRIYA VIDYALAYA

SANGATHAN

STUDY MATERIAL(Computer Science (083))

Class – XII

(STUDY MATERIAL FOR LOW ACHIEVERS)

2016-17

TIPS TO STUDENTS

Page 2: Web viewAns: Message switching: The source computer sends data message to the switching office, which stores data in abuffer.It then looks for a free link to

1. Prepare those questions first, which you feel easy for you.

2. Important terms of a topic must be memorized.

3. Practice the solutions in writing rather than just reading.

4. Practice on similar type question at a time.

Page 3: Web viewAns: Message switching: The source computer sends data message to the switching office, which stores data in abuffer.It then looks for a free link to

INDEX1. List of Functions and their header files2. Object Oriented Programming3. Find Errors in the given program4. Find output of the given program5. Class & Objects6. File Handling7. Data Structures8. Databases and SQL9. Boolean Algebra10. Network and Communications

Page 4: Web viewAns: Message switching: The source computer sends data message to the switching office, which stores data in abuffer.It then looks for a free link to

FUNCTIONS AND HEADER FILES:

Function Header Fileclrscr() conio.hgetch() conio.htoupper( ) ctype.hisupper() ctype.hisdigit() ctype.htoupper() ctype.hisalnum() ctype.hsetw() iomanip.hexp() math.hlog() math.hcos() math.hfabs() math.hstrcmp() string.hstrcpy() string.hstrcat() string.hstrlen() string.hgets() studio.hputs() studio.h

DEFINITIONS:

Data Abstraction: It is the act of representing the essential features without including the background details and explanations

Encapsulation: Wrapping up of the data and function together in a single unit is called an encapsulation.

Inheritance: It is the capability of one class to inherit properties from other class. The class which is inherited is called the base class o super class and class which inherits from other class is called derived class or sub class.

Polymorphism: It is the ability for a message or data to be processed in more than one form.

Page 5: Web viewAns: Message switching: The source computer sends data message to the switching office, which stores data in abuffer.It then looks for a free link to

Function Overloading: A function name having several definitions that are diffentiable by the number or types of their arguments is known as an overloaded function and this process is known as function overloading.

Constructor function: A constructor is the function declared inside a class having same name as that of the class and used to initialize the data members of that class. The important property of the constructor is that it is called automatically when an object of class is created and has no return type not even void.

Destructor function: A destructor is the function declared inside a class having same name as that of the class along with ~ (tilde symbol) and used to release the memory engaged while initializing the data members of a class.

FIND ERRORS:

Rewrite the following program after removing the syntactical error(s) if any. Underline each correction.

#include <iostream.h>const int Size 5;void main()

int Array[Size];Array = 50,40,30,20,10;for(Ctr=0; Ctr<Size; Ctr++)cout>>Array[Ctr];

Ans:

#include<iostream.h>const int Size =5;void main( )int Array[Size]=50,40,30,20,10;for(int Ctr=0;Ctr<Size;Ctr++)

Page 6: Web viewAns: Message switching: The source computer sends data message to the switching office, which stores data in abuffer.It then looks for a free link to

cout<<Array[Ctr];

Rewrite the following program after removing th syntactical errors (if any). Under line each correction.

#include <stdio.h>Void main()

int s1, s2, num;s1=s2=0;for (x=0, x<10, x+=2)

cin<< num;if (num>0) s1+=num; else s2=/num;

cout<<s1<<s2;

Ans:#include<iostream.h> // for cin & cout #include <stdio.h>void main()

int s1, s2, num;s1=0; S2=0for (int x=0; x<10; x+=2)

cin>> num;if (num>0)

s1+=num; else

s2/=num;cout<<s1<<s2;

Rewrite the following program after removing the syntactical error(s), if any Underline each correction:#include <iostream.h>void main( )

Page 7: Web viewAns: Message switching: The source computer sends data message to the switching office, which stores data in abuffer.It then looks for a free link to

struct TV

char Manu_name[20];char Tv_Type;int Price = 17000;

New Tv;gets(Manu_name);gets(Tv_Type);

Ans:

#include <iostream.h>void main( )

struct TV

char Manu_name[20];char Tv_Type[10]; //Tv_Type[10]int Price = 17000;

New_Tv; //New_Tvgets(New_Tv.Manu_name); //New_Tv.Manu_namegets(New_Tv.Tv_Type); //New_Tv.Tv_Type

Rewrite the following program after removing the syntactical errors ( if any). Underline each correction.

#include<iostream.h>#include<stdio.h>Class MyStudent

int StudentId = 101char Name[20];publicMyStudent()void Register()cin>>StudentId; gets(Name);void Display()

Page 8: Web viewAns: Message switching: The source computer sends data message to the switching office, which stores data in abuffer.It then looks for a free link to

cout<<StudentId<<”:”<<Name <<endl;

;void main()

MySTudent MS;Register.MS();MS.Display();

Ans: The underlined corrections are:

#include<iostream.h>#include<stdio.h>class MyStudent

int StudentId;char Name[20];public:

MyStudent()void Register()cin>>StudentId; gets(Name);void Display()cout<<StudentId<<”:”<<Name <<endl;

;void main()

MySTudent MS;MS.Register();MS.Display();

OUTPUTS:

Page 9: Web viewAns: Message switching: The source computer sends data message to the switching office, which stores data in abuffer.It then looks for a free link to

Find the output of the following program :#include<iostream.h>int fun ( int &a, int b = 1)

if (a % b == 0) return ++ a;

else return b -- ;

void main()

int x = 20, y = 23;y = fun (x, y);cout << x << “, “ << y << ‘\n’;x = fun (y);cout << x << “, “ << y << ‘\n’;y = fun (x);cout << x << “, “ << y << ‘\n’;

Ans:20, 2324, 24 25, 25

Find the output of the following program :#include<iostream.h>void Change (int x[4], int i)

x[i] = x[i] * i;void main ( )

int x[ ] = 11, 21, 31, 41;for (int i = 0; i < 4; i++)

Change (x, i);cout << x[i] << ‘\n’;

Page 10: Web viewAns: Message switching: The source computer sends data message to the switching office, which stores data in abuffer.It then looks for a free link to

Ans:02162123

In the following program, if the value of N given by the user is 20, what maximum andminimum value the program could possibly display ()?

#include<iostream.h>#include<stdlib.h>void main()

int N, Guessme;randomize();cin>>N;Guessme = random(N-10) + 10 ;cout<<Guessme<<endl;

Ans:Any value between 10 to 20

Find the output of the following program :

#include<iostream.h> void main()

int Numbers[] = 2,4,8,10; int *ptr = Numbers; for (int C = 0; C<3; C++)

cout<< *ptr << “@”; ptr++;

cout<<endl; for(C = 0; C<4; C++)

Page 11: Web viewAns: Message switching: The source computer sends data message to the switching office, which stores data in abuffer.It then looks for a free link to

(*ptr)*=2; --ptr;

for(C = 0; C<4; C++)

cout<< Numbers [C]<< “#”;

Ans:2@4@8@4#8#16#20#

Find the output of the following program :

#include<iostream.h> void Indirect(int Temp=20)

for (int I=10; I<=Temp;I++) cout<<I<<” , “ ;

cout<<endl; void Direct (int &Num)

Num+=10; Indirect(Num);

void main()

int Number=20; Direct(Number) ; Indirect(); cout<< “ Number=”<<Number ;

Ans:10, 11, 12, 13, 14, 15, 16, 17, 18, 19 ,20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30,10, 11, 12, 13, 14, 15, 16, 17, 18, 19 ,20,Number=30

Page 12: Web viewAns: Message switching: The source computer sends data message to the switching office, which stores data in abuffer.It then looks for a free link to

In the following C++ program what is the expected value of Myscore from Options (i) to (iv) given below. Justify your answer.

#include<stdlib.h> #include<iostream.h> void main( )

randomize();int Score[] = 25,20,34,56,72,63, Myscore; Myscore = Score[2 + random(2)]; cout<<Myscore<<endl;

(i) 25 (ii) 34 (iii) 20 (iv) None of the above

Ans:(ii) 34

Find the output of the following program.

#include<iostream.h>struct PLAY

int score, bonus;;void Calculate(PLAY &P, int N=10)

P.score++;P.bonus+=N;

viod main()

PLAY PL= 10,15;Calculate (PL);cout<<PL.score<<”:”<<PL.bonus<<endl;Calculate(PL,15)cout<<PL.score<<”:”<<PL.bonus<<endl;

Page 13: Web viewAns: Message switching: The source computer sends data message to the switching office, which stores data in abuffer.It then looks for a free link to

Ans: The answer is 11: 2512: 40

Find the output of the following program:#include<iostream.h>void main( )

int A[ ] = 10,15,20,25,30;int *p =A;while ( *p < 30)

if (*p % 3 ! = 0)*p = *p +2;

else*p= *p +1;

p++;

for ( int j=0; j<=4; j++)

cout<<A[j] <<”*”;if (j % 3 == 0) cout <<endl ;

cout<< A[4] * 3 <<endl;

Ans:- The output is as:12 *16 *22 * 27*30*90

Find the output of the following program:#include<ctype.h>void Secret (char Msg[ ], int N);void main( )

char SMS[ ] = “rEPorTmE”;

Page 14: Web viewAns: Message switching: The source computer sends data message to the switching office, which stores data in abuffer.It then looks for a free link to

Secret( SMS,2);Cout << SMS<< endl;

void Secret(char Msg[], int N)

for(int C = 0;Msg [C] ! = ‘\0’; C++)if (C % 2 == 0)

Msg [C] =Msg [C +N;else if (isupper(Msg([C]))

Msg[C]= tolower(Msg[C]);else

Msg[C] = Msg[C] –N;Ans: The output is : teRmttoe

DEFINE CLASS:

Define a class CIRCLE in C++ with the description given below : Private Members :

X integer typeY integer typeRadius float typeArea Float typeCalc_area() A function which calculates area of circle and return it.

Public Members:GetDetails() A function to input X, Y, Radius and invoke Calc_area() and

store the returned value in Area.ShowDetails() A function to show all the data members of the class.

Ans:class CIRCLEprivate:

int x, y;float radius, area;float Calc_area( )

return 3.14*radius*radius;

public:void GetDetails()

Page 15: Web viewAns: Message switching: The source computer sends data message to the switching office, which stores data in abuffer.It then looks for a free link to

cout<<”Enter value of x”;cin>>x;cout<<”Enter value of y”;cin>>y;cout<<”Enter radius “;cin>>radius;area=calc_area();

void ShowDetails()

cout<<”X= “<<x<<endl;cout<<”Y= “<<y<<endl;cout<<”Radius= “<<radius<<endl;cout<<”Area= “<<area<<endl;

;

Define a class Travel in C++ with the description given below : Private Members: T_Code of type string No_of_Adults of type integer No_of_Children of type interger Distance of type integer

TotalFare of type float

Public Members : A constructor to assign initial values as follows :

T_Code with the word “NULL”

No_of_Adults as 0No_of_Children as 0Distance as 0TotalFare as 0

A function AssignFare( ) which calculates and assigns the value of the data member TotalFare as follows :For each Adult

Fare (Rs) For Distance (Km)500 >=1000300 <1000 & >=500200 <500

For each Child the above Fare will be 50% of the Fare mentioned in the above

Page 16: Web viewAns: Message switching: The source computer sends data message to the switching office, which stores data in abuffer.It then looks for a free link to

table.

A function EnterTravel( ) to input the values of the data members T_Code, No_of_Adults, No_of_Children and Distance; and invoke the AssignFare( ) function.

A function ShowTravel( ) which displays the content of all the data members for a Travel.

Ans:class Travelprivate:

char T_Code[20];int No_of_Adults;int No_of_Children;int Distance;float TotalFare;

public:Travel()

strcpy(T_Code,”NULL”);No_of_Adults=0;No_of_Children=0;Distance=0;TotalFare=0;

void AssignFare()

if(Distance>=1000)

TotalFare=No_of_Adults*500+No_of_Children*250;else if(Distance>=500)

TotalFare=No_of_Adults*300+No_of_Children*150;else

TotalFare=No_of_Adults*200+No_of_Children*100;

Page 17: Web viewAns: Message switching: The source computer sends data message to the switching office, which stores data in abuffer.It then looks for a free link to

void EnterTravel()

cout<<”Enter Travel Code “;cin>>T_Code;cout<<”Enter No. of Adults “;cin>>No_of_Adults;cout<<”Enter No. of children “;cin>>No_of_Children;cout<<”Enter Distance “;cin>>Distance;AssignFare();

void ShowTravel()

cout<<”T Code=”<<T_Code<<endl;cout<<”No of Adults=”<<No_of_Adults<<endl;cout<<”No of Children=”<<No_of_Children<<endl;cout<<”Distance=”<<Distance<<endl;cout<<”Total Fare=”<<TotalFare<<endl;

;

Define a class BOOK with the following specification.

Private members of the class BOOK are BOOK_NO integer type BOOK_TITLE 20 characters PRICE float(Price per copy) TOTAL_COST() A function to calculate the total cost for N

number of copies, where N is passed to the function as argument

Public members are INPUT() Function to readBOOK_NO,BOOK_TITLE,PRICE

Page 18: Web viewAns: Message switching: The source computer sends data message to the switching office, which stores data in abuffer.It then looks for a free link to

PURCHASE() Function to ask the user to input the number of copies to be purchased. It invokes TOTAL_COST() and prints the total cost to be paid by the user.

SHOW() Function to show book details..Ans:class BOOKprivate:

int BOOK_NO;char BOOK_TITLE[20];float PRICE;void TOTAL_COST(int N)

cout<<”Amount to pay Rs. “<<N*PRICE;

public:void INPUT()

cout<<”Enter book no. “;cin>>BOOK_NO;cout<<”Enter book title “;cin>>BOOK_TITLE;cout<<”Enter price “;cin>>PRICE;

void PURCHASE()

int N;cout<<”Enter number of copies “;cin>>N;TOTAL_COST(N);

void SHOW()

cout<<”Book No. : “<<BOOK_NO<<endl;cout<<”Book Title : “<<BOOK_TITLE<<endl;cout<<”Price : “<<PRICE<<endl;

;

Page 19: Web viewAns: Message switching: The source computer sends data message to the switching office, which stores data in abuffer.It then looks for a free link to

Define a class named MOVIE in C++ with the following description:Private members

HALL_NO integerMOVIE_NAME Array of characters (String)WEEK integer (Total number of weeks the same movie is shown)WEEK_COLLECTION FloatTOTAL_COLLECTION Float

Public MembersFunction Read_Data( ) to read an object of ADMISSION typeFunction Display( ) to display the details of an objectFunction Update( ) to update the total collection and Weekly collection

once in a week changes. Total collection will be incremented by Weekly collection and Weekly collection is made Zero

Ans:class MOVIEprivate:int HALL_NO;char MOVIE_NAME[20];int WEEK;float WEEK_COLLECTION, TOTAL_COLLECTION;public:void Read_Data();void Display();void Update();;

void MOVIE::Read_Data()

cout<<"Enter Hall No. ";cin>>HALL_NO;cout<<"Enter Movie Name ";gets(MOVIE_NAME);WEEK=0;WEEK_COLLECTION=0;TOTAL_COLLECTION=0;

void MOVIE::Display()

Page 20: Web viewAns: Message switching: The source computer sends data message to the switching office, which stores data in abuffer.It then looks for a free link to

cout<<"Hall No. : "<<HALL_NO<<endl;cout<<"Movie Name : "<<MOVIE_NAME<<endl;cout<<"Week : "<<WEEK<<endl;cout<<"Week Collection : "<<WEEK_COLLECTION<<endl;cout<<"Total Collection :

"<<TOTAL_COLLECTION<<endl;

void MOVIE::Update()

cout<<"Enter current week collection ";cin>>WEEK_COLLECTION;WEEK=WEEK+1;TOTAL_COLLECTION+=WEEK_COLLECTION;

void main()

MOVIE m;int choice;do

clrscr();cout<<"1-Create a movie"<<endl;cout<<"2-Display information"<<endl;cout<<"3-New Collection"<<endl;cout<<"4-Exit"<<endl;cout<<"Enter your choice(1, 2, 3 or 4)?";cin>>choice;switch(choice)

case 1: m.Read_Data();break;

case 2: m.Display();break;

case 3: m.Update();break;

getch();

while(choice!=4);

QUESTIONS BASED ON CLASSES

Page 21: Web viewAns: Message switching: The source computer sends data message to the switching office, which stores data in abuffer.It then looks for a free link to

Given the following C++ code, answer the questionsClass TEST

int time;public:TEST( ) //Function 1

time=0;cout<< ”hai”;

~ TEST( ) //Function 2

cout<< ”hello”;void exam( ) //Function 3

cout<<”god bless u”;TEST(int Duration) //Function 4

time=Duration;cout<<”Exam starts”;

TEST(TEST &T) //Function 5

time = T.Duration;cout<<”Exam Finished”

;(a) In Object Oriented Programming, what is Function 1 referred as and when does it get invoked/called?(b) In Object Oriented Programming, what is Function 2 referred as and when does it get invoked / called?(c) Which category of constructors does Function 5 belong to and what is the purpose of using it?(d) Write statements that would call the member Function 1 and 4.

Ans :(a) Default constructor; It is invoked when an object of this class, without parameter, is created.(b) Destructor; It is invoked when an object is destroyed.

Page 22: Web viewAns: Message switching: The source computer sends data message to the switching office, which stores data in abuffer.It then looks for a free link to

(c) Copy Constructor; Purpose of using copy constructor is to copy values of an existing object into a newly created object.(d) TEST t1, t2(5);

Consider the following C++ declaration and answer the questions given below:class PUBLISHER

char pub[12];double turnover;protected:void register( );public:PUBLISHER( );void enter( );void display( );

;class BRANCH

char city[20];protected:float employees;public:BRANCH( );void haveit( );void giveit( );

;class AUTHOR: private BRANCH, public PUBLISHER

int acode;char aname[20];float amount;public:AUTHOR( );void start( );void show( );

;(a) Write the names of data members, which are accessible from objects belonging to class AUTHOR.(b) Write the names of all the member functions which are accessible from objects belonging to class BRANCH.(c) Write the names of all the members which are accessible from member functions of class AUTHOR.

Page 23: Web viewAns: Message switching: The source computer sends data message to the switching office, which stores data in abuffer.It then looks for a free link to

(d) How many bytes will be required by an object belonging to class AUTHOR?(e) Write the public members of the class AUTHOR.

Ans:(a) No data members(b) BRANCH( ), haveit( ), giveit( )(c) acode, aname, amount, AUTHOR( ), start( ), show( ) employees, BRANCH( ), haveit( ), giveit( ) register( ), PUBLISHER( ), enter( ), display( )(d) 70 bytes(e) AUTHOR( ), start( ), show( ), PUBLISHER( ), enter( ), display( )

Answer the questions (i) to (iii) based on the following code:class furniture

char Type;char Model[10];public:furniture();void Read_fur_details( );void Disp_fur_details( );

;class sofa : public furniture

int no_of_seats;float cost_of_sofa;public:void Read_sofa_details( );void Disp_sofa_details( );

;class office: private sofa

int no_of_pieces;char delivery_date[10];public:void Read_office_details( );void Disp_office_details( );

;void main( ) office MyFurniture;

Page 24: Web viewAns: Message switching: The source computer sends data message to the switching office, which stores data in abuffer.It then looks for a free link to

(a) Mention the member names which are accessible by MyFurniture declared in main ( )function.(b) What is the size of MyFurniture in bytes?(c) Mention the names of functions accessible from the member functionRead_office_details ( ) of class office.

Ans:(a) Read_office_details( ), Disp_office_details( )(b) 29 bytes(c) Read_office_details( ), Disp_office_details( ), Read_sofa_details( ), Disp_sofa_details( ), furniture( ), Read_fur_details( ), Disp_fur_details( )

Answer the questions (i) and (ii) after going through the following class: class Sciencechar Topic[20];int Weightage;public:Science ( ) //Function 1strcpy (Topic, “Optics” );Weightage = 30;cout<<“Topic Activated”;~Science( ) //Function 2cout’<<”Topic Deactivated”;(i) Name the specific features of class shown by Function 1 and Function2 in the above example.(ii) How would Function 1 and Function 2 get executed ?

Ans:(i) Function 1: Constructor/ Default ConstructorFunction 2: Destructor(ii) Function 1 is executed or invoked automatically when an object ofclass Science is created.Function 2 is invoked automatically when the scope of an object of

Page 25: Web viewAns: Message switching: The source computer sends data message to the switching office, which stores data in abuffer.It then looks for a free link to

class Science comes to an end.

Answer the questions (i) to (iv) based on the following code : class Teacherchar TNo[5], TName[20], DeptflO];int Workload;protected:float Salary;void AssignSal(float);public:Teacher( ) ;void TEntry( ) ;void TDisplay( );;class Studentchar Admno[10], SName[20], Stream[10];protected:int Attendance, TotMarks;public:Student( );void SEntry( );void SDisplay( );;class School : public Student, public Teacher;char SCode[10], SchName[20];public:School ( ) ;void SchEntry( );void SchDisplay( );;(i) Which type of Inheritance is depicted by the above example ?(ii) Identify the member function(s) that cannot be called directly from the objects of class School from the following :TEntry( )SDisplay( )SchEntry( )(iii) Write name of all the member(s) accessible from member functions ofclass School.

Page 26: Web viewAns: Message switching: The source computer sends data message to the switching office, which stores data in abuffer.It then looks for a free link to

(iv) If class School was derived privately from class Teacher and privately from class Student, then, name the member function(s) that could be accessed through Objects of class School.

(i) Multiple Inheritance(ii) None(iii) Data Members: SCode, SchName, Attendance, TotMarks,SalaryMember Functions: SchDisplay(), SchEntry(), SEntry(), SDisplay( ), TEntry( ), TDisplay( ), AssignSal( )(iv) SchEntry( ),SchDisplay( ).

FILE HANDLING

Observe the program segment carefully and answer the question that follows:class student

int student_no;char student_name[20];int mark;public:void enterDetail( );void showDetail( );void change_mark( ); //Function to change the markint getStudent_no( ) return student_no;

;void modify( int y )

fstream File;File.open( “student.dat”, ios::binary|ios::in|ios::out) ;student i;int recordsRead = 0, found = 0;while(!found && File .read((char*) & i , sizeof (i)))recordsRead++;if(i . getStudent_no( ) = = y )i . change_mark( );_________________________//Missing statement 1

Page 27: Web viewAns: Message switching: The source computer sends data message to the switching office, which stores data in abuffer.It then looks for a free link to

_________________________//Missing statement 2found = 1;if( found = = 1)cout<<”Record modified” ;File.close() ;

If the function modify( ) is supposed to change the mark of a student having student_no y in the file “student.dat”, write the missing statements to modify the student record.

Ans:(1) File.seekp(-1*sizeof(i), ios::cur);(2) File.write((char*)&i, sizeof(i));

Observe the program segment carefully and answer the question that follows:class item

int item_no;char item_name[20];public:void enterDetail( );void showDetail( );int getItem_no( ) return item_no;

;void modify(item x, int y )

fstream File;File.open( “item.dat”, ios::binary | ios::in | ios::out) ;item i;int recordsRead = 0, found = 0;while(!found && File.read((char*) &i , sizeof (i)))recordsRead++;if(i . getItem_no( ) = = y )_________________________//Missing statementFile.write((char*) &x , sizeof (x));

Page 28: Web viewAns: Message switching: The source computer sends data message to the switching office, which stores data in abuffer.It then looks for a free link to

found = 1;if(! found)cout<<”Record for modification does not exist”;File.close() ;

If the function modify( ) is supposed to modify a record in the file “ item.dat “, whichitem_no is y, with the values of item x passed as argument, write the appropriatestatement for the missing statement using seekp( ) or seekg( ), whichever is needed, inthe above code that would write the modified record at its proper place.

Ans:File.seekp(-1 * sizeof (x), ios::cur);OrFile.seekp(File.tellg( )-sizeof (x));

Observe the program segment given below carefully, and answer the questionthat follows : class Labrecordint Expno;char Experiment[20];char Checked;int Marks;public ://function to enter Experiment detailsvoid EnterExp( );//function to display Experiment detailsvoid ShowExp ( ) ;//function to return Expnochar RChecked ( ) return Checked;//function to assign Marksvoid Assignmarks(int M) Marks = M;;void MpdifyMarks() fstream File;File.open(“Marks.Dat”,ios::binary|ios::in|ios::out);Labrecord L;

Page 29: Web viewAns: Message switching: The source computer sends data message to the switching office, which stores data in abuffer.It then looks for a free link to

int Rec = 0;while (File.read((char*)&L, sizeof(L)))if(L.RChecked( )== ‘ N ‘ )L.Assignmarks(0)elseL.Assignmarks(10)_____________________ //statement 1______________________ //statement 2Rec ++ ;File.close ();If the funption ModifyMarks() is supposed to modify Marks for the records in the file MARKS.DAT based on their status of the member Checked (containing value either V or ‘N’). Write C++ statements for the statement 1 and statement 2, where, statement 1 is required to position the file write pointer to an appropriate place in the file and statement 2 is to perform the write operation with the modified record.

Ans:Statement 1:File.seekp(-1*sizeof(L),ios::cur);Statement 2:File.write((char *) &L,sizeof(L));

Write a function in C++ to print the count of the word the as an independent word inatextfileSTORY.TXT. For example, if the content of the file STORY.TXT is There was a monkey in the zoo. The monkey was very naughty.Then the output of the program should be 2.

Ans://Function to count the word in STORY.TXT filevoid thewordCount()ifstream File(“STORY.TXT”);char String[20];int C=0;while(!File.eof())

Page 30: Web viewAns: Message switching: The source computer sends data message to the switching office, which stores data in abuffer.It then looks for a free link to

File>>String;if(strcmp(String,”the”)==0|| strcmp(String,”The”)==0)C=C+1;cout<<C<<endl;File.close();

Write a function in C++ to print the count of the lines starts with capital letter in a text file JOKES.TXT.

Ans://Function to count the word in JOKES.TXT filevoid LinesCount()ifstream File(“JOKES.TXT”);char String[100];int C=0;while(!File.eof())File.getline(String);if(isupper(String[0]))C=C+1;cout<<C<<endl;File.close();

Write a function in C++ to print the count of the word which start with capital letter in a text file STORY.TXT.

Ans://Function to count the word in STORY.TXT filevoid WordCount()ifstream File(“STORY.TXT”);char String[20];int C=0;

Page 31: Web viewAns: Message switching: The source computer sends data message to the switching office, which stores data in abuffer.It then looks for a free link to

while(!File.eof())File>>String;if(isupper(strcmp[0]))C=C+1;cout<<C<<endl;File.close();

Given a binary file SPORTS.DAT, containing records of the followingstructure type :struct Sportschar Event[20];char Participant[10][30];;Write a function in C++ that would read contents from the file SPORTS.DAT and creates a file named ATHLETIC.DAT copying only those records from SPORTS.DAT where the event name is “Athletics”.

Ans://Function to copy records from SPORTS.DAT to//ATHELETIC.DATvoid SP2AT()fstream spfile,atfile;Sports S;spfile.open(“SPORTS.DAT”,ios::binary|ios::in);atfile.open(“ATHLETIC.DAT”,ios::binary|ios::out);while(spfile.read((char*) &S,sizeof(S)))if(strcmp(S.Event,”Athletics”)==0)atfile.write((char *)&S,sizeof(S));spfile.close();atfile.close();

Given the binary file TELEPHONE.DAT , containing the records of the following

Page 32: Web viewAns: Message switching: The source computer sends data message to the switching office, which stores data in abuffer.It then looks for a free link to

class Directory:class Directorychar name[20];char address[30];char areaCode[5];char phone_no[15];public:void register( );void show( );int checkCode( char AC[] )return strcmp(areaCode, AC);;Write a function COPYABC( ) in C++ , that would copy only those records having areaCode as“123” from TELEPHONE.DAT to TELEBACK.DAT.

Ans://Function to copy records from TELEPHONE.DAT to//TELEBACK.DATvoid COPYABC()fstream phfile,bkfile;Directory D;phfile.open(“TELEPHONE.DAT”,ios::binary|ios::in);bkfile.open(“TELEBACK.DAT”,ios::binary|ios::out);while(phfile.read((char*) &D,sizeof(D)))if(D.checkCode(“123”)==0)bkfile.write((char *)&D,sizeof(D));phfile.close();bkfile.close();

Given the binary file ITEM.DAT, containing the records of the following structure:struct itemint item_no;char item_name[20];

Page 33: Web viewAns: Message switching: The source computer sends data message to the switching office, which stores data in abuffer.It then looks for a free link to

int stock;;

Implement the function AddStock( item x, int n), which updates a record by adding n to the existing stock for the item x in the file.

Ans:void AddStock(item x, int n )

fstream File;File.open( “ITEM.DAT”,ios::binary|ios::in|ios::out);item i;int found = 0;while(!found && File.read((char*)&i, sizeof (i)))if(i.item_no == n )File.seekp(-1*sizeof(i),ios::cur);File.write((char*) &x , sizeof (x));found = 1;if(! found)cout<<”Record for modification does not exist”;File.close() ;

DATA STRUCTURES

Differentiate between data types and Data structure.

Ans: Data type is named group of data with similar characteristics and behavior. i.e. integer, real, Boolean, character etc.

Data Structure is named group of data of different data types, organized in a particular format and characterized by specific operations that can be performed on it.

What is the precondition for applying binary algorithm?

Page 34: Web viewAns: Message switching: The source computer sends data message to the switching office, which stores data in abuffer.It then looks for a free link to

Ans:-For Binary Searchi. the list must be sortedii. lower bound and upper bound of the list must be known.

List four important operations associated with linear data structure.

Ans:-Th four major important operations associated with linear data structure are : sorting, searching, traversing and insertion.

Which of the following sorting: Selection sort, Bubble sort and Insertion Sort is more efficient?

Ans:-Insertion sort.

Why array is called as static data structure?

Ans:-Static data structure is a data structure that requires memory allocation before its processing starts. For such a data structure, a fixed amount of memory is allocated before processing begins. Array follows the same conditions.

2/3 Marks Questions.

Given a one dimensional array A[15] with base address of A as 100, and each element occupies 2 bytes, find the location of A[10].

Ans: In C++, the lower bound of an array is always zero 0.lb = 0ub = 15-1 = 14Base Address b=100Element size S = 2 bytes

Page 35: Web viewAns: Message switching: The source computer sends data message to the switching office, which stores data in abuffer.It then looks for a free link to

I = 10Location of A[I] = b + I-lb x S

= 100 + 10-0x 2 = 100 + 20 = 120

A[10] is at address 120.

Find out the total number of elements and the total size of following arrays. Assuming that each element consumes 4 bytes

a. Z[7]b. Y[-3…7]c. X[5] [4]d. W[-2..2][5..8]

Ans: a. Element: 7,Size : 28 bytesb. Element: U-L +1 = 7--3+1 =11, Size: 11 x 4 = 44 bytes.c. Element: 5x 4 =20; Size : 20x 4 = 80 bytesd. Rows = 2--2+1 = 5, Cols. = 8 – 5 + 1 = 4, Elements :5 x 4 =20;

Size=80 bytes

Given a two dimensional array A[10][20], bas address of A being 100 and width of each element is 4 bytes, fins the location of A[8][15] when the array is stored as a Column wise b Row wise

Ans: a Columnwise

Address[I,J]= B+w [n J-0+I-0] [ in C++ lower bound is 0]Where B= base address, n= no of rows, w= element size,Address A[8][15] = 100 +4[1015-0+8-0] =

100+4[150+8]=100+632=732.

b Row majorAddress[I][J]= B+w [n I-0+J-0] Where B= base address, n= no of columns, w= element size,Address A[8][15] = 100 +4[208-0+15-0] =

100+4[160+15]=100+700=800.

An array V[15][30] is stored in the memory with each element requiring 8 bytes of storage. If the base address of V is 5300, find out memory locations of V[8][12] and V[12][2], if the array is stored along the row.

Page 36: Web viewAns: Message switching: The source computer sends data message to the switching office, which stores data in abuffer.It then looks for a free link to

Ans: Base address, B=5300Element size, W= bytes

Lc = 0, Uc = 29 [Lc: lowest column index; Uc:Uppermost column Index]Lr = 0, Ur = 14 [Lr: lowest row index; Ur:Uppermost row Index]In row major Address of V[I][J] = B + W nI-Lr+J-LcWhere n is number of columnsHere n=30Hence Address of V[8][12] = 5300+8308-0+12-0

= 5300+2016=7316And Address of V[12][2] = 5300+83012-0+2-0

= 5300+2896 = 8196

Write an user defined function Upper-half which takes a two dimensional array A, with size N rows and N columns as argument and point the upper half of the array.

Ans:void Upper_half ( int b[][10], int N)

int i,j;for (i=0;i<N;i++) for (j=0;j<N;j++)

if(i<=j)

cout<< b[i][j]<<”-“; else

cout << “ “;cout<<”\n”;

Define array and pointer

Page 37: Web viewAns: Message switching: The source computer sends data message to the switching office, which stores data in abuffer.It then looks for a free link to

Ans: An array is a group of homologous elements which can store the data of single data type. A pointer is available that holds a memory address, usually the location of another variable in memory.The relationship between the two is that the name of an array is actually a pointer pointing to the first element of the array.

Write an algorithm which finds the locations and values of largest and second largest element in a two dimensional array DATA with N rows and M columns

Ans: Let FL stores the largest element and SL stores the second largest element and pr and pc stores the row and column number.

1. Set row = 0, col =0, pr= 0, pc1=0, pc2=0, pr2=02. Set FL= DATA[0][0], SL = 03. While (row< N) do

col=0while (col<M) do if (FL< DATA[row][col]) then

set FL = DATA[row][col]pr1= rowpc1=col

if (SL< DATA[row][col] ) && ( DATA[row][col] <FL ) then

SL<DATA[row][col]pr2=rowpc2=col

col =col+1

row =row+1

Write a user defined function in C++ to find and display the sum of both the diagonal elements of a two dimensional array MATRX[4][4] containing integer.

Ans:void Diag_sum( )

Page 38: Web viewAns: Message switching: The source computer sends data message to the switching office, which stores data in abuffer.It then looks for a free link to

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

for (j=1;j<m+1;j++)if(i==j)

sum+=A[i][j];else if (j== m- (I + 1))

sum + = A[i][j];

cout<<”Sum of diagonal elements is :”<<sum<,endl;

Write a function SORTSCORE() in C++ to sort an array of structure Examinee in descending order of score using Bubble Sort.Note: Assume the follwing definitions of structure Examineestruct Examnee

long RollNo;char Name[20];float Score;

;

Ans:- #include<iostream.h>#include<conio.h>#include<stdio.h>Struct Examinee

long RollNo;char Name[20];float Score;

;void SORTSCORE( Examinee g[ 10], int n)

int i,j;Examinee temp;for( i=0;i<n;i++)

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

if((g[ j].Score) <g[j+1].Score))

Page 39: Web viewAns: Message switching: The source computer sends data message to the switching office, which stores data in abuffer.It then looks for a free link to

temp = g[j]g[j] =g [ j+1];g[j+1]= temp;

void main ( )

int i=0,n;Examinee g[10];cout<<” Enter No of players(<=10)”;cin>>n;

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

cout<<”Enter Examinee Number:”; cin>>g[i].RollNo;cout<<”Enter Examinee Name:”; cin>>g[i].Name;cout<<”Enter Examinee Score:”; cin>>g[i].Score;

cout<<”\n After Sorting We Have:”;SORTSCORE(g,n);for(i=0;i<n;i++)

cout<<”Player Number:”<<g[i].RollNo;cout<<” Player Name:”;puts(g[i].Name);cout<<” Player Score:”<<g[i].Score;

An array T[50][20] is stored in the memory along the column with each of the element occupying 4 bytes, find out the base address and address of element T[30][15], if an element T[25][10] is stored at the memory location 9800.

Ans:

T[I][J] = B +w (m (J-L2) + (I – L1)T[25][10] = B + 4 (50 (10-0)+(25-0))9800 = B +4( 500+ 25)

= B +4 * 525 = B +2100

Page 40: Web viewAns: Message switching: The source computer sends data message to the switching office, which stores data in abuffer.It then looks for a free link to

B = 9800-2100 = 7700S[30][15] = 7700 +4 (50( 15 – 0) + (30 - 0))

= 7700 + 4 ( 750 + 30)= 7700 + 4*780 = 7700+3120= 10820

Write a function QUEDEL () in C++ to display and delete an element in a dynamically allocated Query containing nodes of the follwing given structure:Struct Node

int Itemno;char Itemname[20] ;NODE * Link;

;

Ans:- Function body to add queue elementsNode * QUEIDEL (NODE * rear, int val,char val1[ ] )NODE * temp;if ( front == NULL)cout<<”Query Empty”;else

temp= front;val = temp - > Itemno;strcpy(val1, temp- > Itemnae);front = front - > Link;delete temp;

return ( front);

Define a function SWAPARR () in C++ to swap (interchange) the first row elements with last row elements, for a two dimensional integer array passed as the argument of the function.

Ans:-The function is as:

Page 41: Web viewAns: Message switching: The source computer sends data message to the switching office, which stores data in abuffer.It then looks for a free link to

void SWAPARR ( int arr[10][10], int m, int n)

Int I,j;cout<<”The original array is \n”;for (i=0;i<m;i++)

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

cout<<arr[i][j]<<”\t”;cout<<endl;

cout<<”The array after swapping columns is \n”;int temp;int k= m-1;for (i=0; i<n; i++)

temp =arr[0][i];arr[0][i]= arr[k][i];arr[k][i]= temp;

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

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

cout<<arr[i][j]<<”\t”;cout<<endl;

Write an algorithm to count total number of nodes in a linked list.

Ans:- 1. ptr = start, count=02. while ptr<> NULL do steps 3 and 4

3. count =count+14. ptr = ptr- > link5. 6. print “ No of Nodes”, count.

Page 42: Web viewAns: Message switching: The source computer sends data message to the switching office, which stores data in abuffer.It then looks for a free link to

Transform each of the follwing prefix expressions to an infix form:(a) + - A B C (b) + - / A C * D E F G

Ans:(a) +-ABC= +(-AB)C

=+ (A-B)C = (A –B) +C

(b) + - / A C * D E F G= + - (/ AC) * D ( E F) G= + - ( A/C) * D ( E F) G= + - (A/C) (* D ( E F)) G= +(- ( A/C) ( D * E F)) G= +(( A/C) – ( D* E F)) G= ( A/C) – ( D* E F) +G

Transform each of the follwing expressions to prefix and postfix form:(a) A +B-C (b) (A+B*C-D) / E * F

Ans:(a) (i) Postfix form A +B-C

=(A+B) –C=(AB+)-C=(AB+C-

(ii) Prefix Form A +B-C=(A+B) –C= (+AB)-C=- + ABC

(b) (i) Postfix form (A+B*C-D) / E * F=((A+(B*C)) – D ) / (E * F)= (( A+(BC*))-D)/(EF*)= ((ABC*+) – D)/ (EF*)= (( ABC* +D-)) / EF*= ABC*+D-EF*/

(ii) Prefix Form (A+B*C-D) / E * F=((A+(B*C)) – D ) / (E * F)= ((A + (*BC))-D)/(*EF)= ((+ A*BC)- D)/ (*EF)= (- + A * BCD) / ( * EF)= /- + A * BCD *EF

Page 43: Web viewAns: Message switching: The source computer sends data message to the switching office, which stores data in abuffer.It then looks for a free link to

Change the following expressions into postfix expression. (A+B)*C+D/E-F using stack implementation.

Ans:Adding ] in the end of the given infix expression to mark its and [ in the stack.[(A+B)*C+D/E-F] scanning from left to right.

Symbol Stack Postfix Expression Y

(

A

+

B

)

*

C

+

D

/

E

-

F

]

[[(

[ ( +

[

[ *

[ *

[ +

[ +

[ + /

[ -

# EMPTY

A

A B

A B +

A B + C

A B + C *

A B + C * D

A B + C * D E

A B + C * D E / +

A B + C * D E / + F

A B + C * D E / + F -

Write a C++ function that inserts an ITEM in an array when the position, where the

Page 44: Web viewAns: Message switching: The source computer sends data message to the switching office, which stores data in abuffer.It then looks for a free link to

ITEM is to be inserted, is given.

Ans:void insert( double ITEM, int pos)

if (pos = = size)arr[pos-1] = ITEM;

elsefor ( int i= size -1; i>pos; i--)

arr[i] = arr[i-1];arr[pos-1] = ITEM;

Write a C++ function that searches a given ITEM in an array using linear search technique. If the ITEM is found, it should return its position in the array, otherwise it should return -1.

Ans:int Isearch( double ITEM)

int i, pos= -1;for ( i=0; i<size; i++)

if arr[i] == ITEM ) pos = i+1; break;

return pos;

Consider the following declaration of linked stack, used by operating system in store instruction and its address. Define the function pop( ) for it.

struct Inst_stk

long mem_add;char instruction[40];Inst_stk * next;

*top, *temp;

Ans:

Page 45: Web viewAns: Message switching: The source computer sends data message to the switching office, which stores data in abuffer.It then looks for a free link to

Inst_stk *pop(Inst_stk *top)

Inst_stk * temp;Int madd;clrscr();char tins [40];if (top == NULL)

cout<<”Stack Empty”;

elsetemp= top;top = top - > next;madd= temp -> mem_add;strcpy(tins, temp->instruction);temp->next = NULL;cout<<”\n\t Popped member add is :” << madd;cout<<”\n\t Popped instruction is :” << tins;delete temp;

return ( top);

Page 46: Web viewAns: Message switching: The source computer sends data message to the switching office, which stores data in abuffer.It then looks for a free link to

Structure Query Language.A non-procedual UGL used for querying upon relational database

DDL: Data Defination Langage. SQL part-language that facilitates defining creation/modification etc of database object such as tables,indexes,sequences etc.

DML: Data Manipulation Langage. SQL part-language that facilitates manipulation(aditions/deletions/modification) of data residing in database tables.

Meta Datafacts/data about the data stored in table.

Data DictionaryA file containg meta data

Differentiate between Candidate Key and Alternate Key in context of RDBMS

Candidate Key: A Candidate Key is the one that is capable of becoming Primary key i.e., a field or attribute that has unique value for each row in the relation. Alternate Key: A Candidate Key that is not a Primary key is called an Alternate Key.

Differentiate between Candidate Key and Primary Key in context of RDBMS

Ans:Candidate Key: A Candidate Key is the one that is capable of becoming primary key i.e, a field or attribute that has unique value for each row in the relation.Primary Key is a designated attribute or a group of attributes whose values can uniquely identify the tuples in the relation.

Consider the following tables item and Customer. Write SQL Commands for the

Page 47: Web viewAns: Message switching: The source computer sends data message to the switching office, which stores data in abuffer.It then looks for a free link to

statement (i) to (iv) and give outputs for SQL queries (v) to (viii).

Table: ITEMI_ID ItemName Manufacture Price

PC01 Personal Computer ABC 35000LC05 Laptop ABC 55000PC03 Personal Computer XYZ 32000PC06 Personal Computer COMP 37000LC03 Laptop PQR 57000

Table :CUSTOMER

C_ID CustomerName City l_ID01 MRS REKHA Delhi LC0306 MANSH Mumbai PC0312 RAJEEV Delhi PC0615 YAJNESH Delhi LC0316 VIJAY Banglore PC01

(i) To display the details of those customers whose city is Delhi.(ii) To display the details of item whose price is in the range of 35000 to

55000 ( both values included)(iii) To display the customer name, city from table Customer, and itemname

and price from table Item, with their corresponding matching I_ID.(iv) To increase the price of all items by 1000 in the table Item.(v) SELECT DISTINCT City FROM Customer;(vi) SELECT ItemName, MAX(Price), Count(*)

FROM Item GROUP BY ItemName;(vii) SELECT CustomerName, Manufacturer

FROM Item, CustomerWHERE Item.Item_Id=Customer.Item_Id

(viii) SELECT ItemName, Price* 100FROM Item WHERE Manufacture= ‘ABC’;

Answer:

(i) SELECT * FROM CUSTOMERWHERE City = ‘Delhi’;

Page 48: Web viewAns: Message switching: The source computer sends data message to the switching office, which stores data in abuffer.It then looks for a free link to

(ii) SELECT * FROM ITEMWHERE PRICE BETWEEN 35000 TO 55000;

(iii) SELECT CustomerName, City, ItemName, PriceFROM CUSTOMER, ITEMWHERE CUSTOMER.I_ID = ITEM.I_ID;

(iv) UPDATE ITEMSET Price = Price + 1000 ;

(v) DelhiMumbai

Banglore

(vi) Personal computer 37000 3 Laptop 57000 2

(vii)

(viii) Personal computer 3500000 Laptop 5500000

Consider the following tables Product and Clint. Write SQL commands for the statement (i) to (iv) and give outputs for SQL queries (v) to (viii)

Table: PRODUCT

P_ ID ProductName Manufacturer PriceTP01 Talcom Powder LAK 40FW05 Face Wash ABC 45BS01 Bath Soap ABC 55SH06 Shampoo XYZ 120FW12 Face Wash XYZ 95

MRS REKHA PQRMANSH XYZRAJEEV COMPYAJNESH PQRVIJAY ABC

Page 49: Web viewAns: Message switching: The source computer sends data message to the switching office, which stores data in abuffer.It then looks for a free link to

Table:CLINT

C_ID ClientName City P_ID01 Cosmetic Shop Delhi FW0506 Total Health Mumbai BS0112 Live Life Delhi SH0615 Pretty Woman Delhi FW1216 Dreams Banglore TP01

(i) To display the details of those Clients whose City is Delhi.(ii) To display the details of Products Whose Price is in the range of 50 to

100(Both values included).(iii) To display the ClientName, City from table Client, and ProductName

and Price from table Product, with their corresponding matching P-ID.(iv) To increase the Price of all Products by 10.(v) SELECT DISTINCT City FROM Client”(vi) SELECT Manufacturer, MAX(Price), Min(Price), Count(*)

FROM Product GROUP BY Manufacturer;(vii) SELECT ClientName, ManufacturerName

FROM Product, ClientWHERE Client.Prod-ID=Product.P_ID;

(viii) SELECT ProductName, Price * 4FROM Product;

Answer:

(i) SELECT * FROM CLIENT WHERE City=”Delhi”;

(ii) SELECT * FROM PRODUCT WHERE Price between 50 to 100;

(iii) SELECT ClientName, City, ProductName, Price FROM CLIENT, PRODUCT

WHERE CLIENT.P_ID=Product.P_ID;

(iv) Update PRODUCT SET Price=Price+10

(v) Delhi

Page 50: Web viewAns: Message switching: The source computer sends data message to the switching office, which stores data in abuffer.It then looks for a free link to

MumbaiBangalore

(vi) LAK 40 40 1ABC 55 45 2XYZ 120 95 2

(vii) Cosmetic Shop Face WashTotal Health Bath SoapLive Life ShampooPretty Woman Face WashDreams Talcom Powder

(viii) Talcom Powder 160Face Wash 180Bath Soap 220Shampoo 480Face Wash 380

Consider the following tables. Write SQL commands for the statements (i) to (iv) and give outputs for SQL queries (v) to (viii)

TABLE : SENDERSenderID SenderName SenderAddress SenderCityND01 R Jain 2, ABC Appts New DelhiMU02 H Sinha 12, Newton MumbaiMU15 S Jha 27/A, Park Street MumbaiND50 T Prasad 122-K, SDA New Delhi

TABLE : RECIPIENTRecID SenderID RecName RecAddress RecCityKO05 ND01 R Bajpayee 5, Central Avenue KolkataND08 MU02 S Mahajan 116, A Vihar New

DelhiMU19 ND01 H Singh 2A, Andheri East MumbaiMU32 MU15 P k Swamy B5, C S Terminus MumbaiND48 ND50 S Tripathi 13, B1 D, Mayur

ViharNew Delhi

(i) To display the names of all Senders from Mumbai(ii) To display the RecID, SenderName, SenderAddress, RecName, RecAddress for every Recipient

Page 51: Web viewAns: Message switching: The source computer sends data message to the switching office, which stores data in abuffer.It then looks for a free link to

(iii) To display Recipient details in ascending order of RecName(iv) To display number of Recipients from each city(v) SELECT DISTINCT SenderCity FROM Sender;(vi) SELECT A.SenderName, B.RecName FROM Sender A, Recipient b WHERE A.SenderID=B.SenderID AND B.RecCity= ‘Mumbai’;(vii) SELECT RecName, RecAddress FROM Recipient WHERE RecCity NOT IN( ‘Mumbai’, ‘Kolkata’);(viii) SELECT RecID, RecName FROM Recipient WHERE SenderID= ‘MU02’ or SenderID= ‘ND50’;

Answer:(i) SELECT SenderName FROM Sender

WHERE SenderCity= “Mumbai”; (ii) SELECT RecID, SenderName, SenderAddress, RecName, RecAddress

FROM Sender, Recipient WHERE Sender.SenderID= Recipient.SenderID;

(iii) SELECT * FROM RecipientORDER BY RecName Asc;

(iv) SELECT RecCity, count(*)FROM RecipientGROUP BY RecCity;

(v) New Delhi Mumbai (vi) R Jain H Singh S Jha P K Swamy (vii) S Mahajan 116, A Vihar S Tripathi 13, B1 D, Mayur Vihar

(viii) ND08 S Mahajan ND45 S Tripathi

Consider the following tables Consignor and Consignee. Write SQL commands for the statements (i) to (iv) and give outputs for SQL queries (v) to (viii).

Page 52: Web viewAns: Message switching: The source computer sends data message to the switching office, which stores data in abuffer.It then looks for a free link to

TABLE: CONSIGNOR

CnorID CnorName CnorAddress CityND01 R Singhal 24, ABC

EnclaveNew Delhi

ND02 Amit Kumar 123, Palm Avenue

New Delhi

MU15 R Kohli 5/A, South Street

Mumbai

MU50 S Kaur 27-K, Westend Mumbai

TABLE: CONSIGNEE

CneeID CnorID CneeName CneeAddress CityMU05 ND01 Rahul Kishore 5, Park

AvenueMumbai

ND08 ND02 P Dhingra 16/J, Moore Enclave

New Delhi

KO19 MU15 A P Roy 2A, Central Avenue

Kolkata

MU32 ND02 S Mittal P 245, AB Colony

Mumbai

ND48 MU50 B P Jain 13, Block D, A Vihar

New Delhi

(i) To display the names of all Consignors from Mumbai.

(ii) To display the CneeID, CnorName, Cnoraddress, CneeName, CneeAddress for every Consignee.

(iii) To display Consignee details in ascending order of CneeName.

(iv) To display numbers of Consignors from each city.

(v) SELECT DISTINCT City FROM Consignee; (vi) SELECT A.CnorName, B.CneeName FROM Consignor A, Consignee B WHERE A.CnorID=B.CnorID AND B.CneeCity= ‘Mumbai’;

(vii) SELECT CneeName, CneeAddress

Page 53: Web viewAns: Message switching: The source computer sends data message to the switching office, which stores data in abuffer.It then looks for a free link to

FROM Consignee WHERE CneeCity NOT IN ( ‘Mumbai’, ‘Kolkata’);

(viii) SELECT CneeID, CneeName FROM Consignee WHERE CnorId= ‘MU15’ OR CnorId= ‘ND01’;

Answer:(i) SELECT CnorName

FROM CONSIGNORWHERE City= “Mumbai”;

(ii) SELECT CneeID, CnorName, CnorAddress, CneeName, CneeAddress FROM CONSIGNOR, CONSIGNEE WHERE CONSIGNOR. CnorID= CONSIGNEE.CNorID

(iii) SELECT * FROM CONSIGNEE ORDER BY CneeName ASC;

(iv) SELECT CneeCity, Count(CneeCity)) FROM CONSIGNEE GROUP BY CneeCity

(v) There is no column by the name City in the table CONSIGNEE. However, if we change the column from City to CneeCity, the query result as:

CneeCityMumbaiNew DelhiKolkata

(vi) R. Singhl Rahul kishore Amit Kumar S Mittal

(vii) P Dhingra 16/J Moore Enclave BP Jain 13, Block D, A Vihar

(viii) MU05 Rahul kishore KO19 A P Roy

Page 54: Web viewAns: Message switching: The source computer sends data message to the switching office, which stores data in abuffer.It then looks for a free link to

What is a Binary decision? What do you mean by a binary valued variable?

Ans. The decision which results into either YES (TRUE) or NO (FALSE) is called is a binary decision. The variables which can store these truth values are called logical variables or binary valued variables.

What do you mean by Tautology and Fallacy?

Ans. If result of any logical statement or expression is always TRUE or 1, it is called Tautology and if the result is always FALSE or 0, it is called Fallacy.

Why are NAND and NOR Gates are called Universal gates? ORWhich gates are called Universal gates and why?

Ans. NAND and NOR Gates are called Universal Gates. Because:(i) These are less expansive and easier to design.(ii) Other switching function (AND, OR, NOT) can easily by

implementing using NAND/NOR gates.

Define Gray Code?

Ans. A Binary code in which each successive numbers differs in only in one bit position is called Gray code.

What do you understand by a Maxterm and Minterm?

Ans.

Page 55: Web viewAns: Message switching: The source computer sends data message to the switching office, which stores data in abuffer.It then looks for a free link to

A Minterm is a product of all the literals (with or without the bar) with in the logical system.A Maxterm is a sum of all the literals (with or without the bar) is called the Maxterm.

Define Canonical Expression?

Ans. A Boolean expression composed entirely either of Maxterms and Minterms is referred to as Canonical Expression.

Write the Principle of Duality?

Ans. This is a Very important principle used in Boolean algebra. This states that starting with a Boolean relation, another Boolean relation can be derived by(i) Changing each OR sign (+) to an AND (.) sign.(ii) Changing each AND sign (.) to an OR (+) sign.(iii) Replacing each 0 by 1 and each 1 by 0.for example:0+0=0 than by the duality principle 1.1=1

Write the dual of Boolean expression A+B’.C

Ans. A. (B’+C)

Write the dual of following Boolean expression (B’+C). A

Ans. (B’.C) +A

Five inverter are cascaded one after another. What is the output if the input is 1?

Page 56: Web viewAns: Message switching: The source computer sends data message to the switching office, which stores data in abuffer.It then looks for a free link to

Ans. The output will be 0.

Prove algebraically: X.Y’+Y’.Z = X.Y’.Z + XY’Z’ + X’.Y’.Z

Ans. LHS = X.Y’ + Y’.Z = X.Y’.1 + 1.Y’.Z = X.Y’. (Z+Z’) + (X+X’). Y’.Z = X.Y’.Z + X.Y’.Z’ + X.Y’.Z + X’.Y’.Z =XY’Z + XY’Z’ + X’Y’Z =RHS

Prove algebraically:XY+YZ+YZ’ =Y

Ans. LHS = XY+YZ+YZ’ = XY + Y. (Z+Z’) = XY + Y.1 = Y. (X+1) = Y.1

= Y

Prove algebraically:XY+YZ+Y’Z = XY+Z

Ans. LHS = XY+YZ+Y’Z = XY + (Y+Y’) Z = XY + 1.Z = XY + Z = RHS

Prove algebraically: X.Y+X’.Z+Y.Z = X.Y +X’.Z

Ans. LHS= X.Y+X’Z+Y.Z

Page 57: Web viewAns: Message switching: The source computer sends data message to the switching office, which stores data in abuffer.It then looks for a free link to

= X.Y+X’Z+1.Y.Z = X.Y+X’.Z+ (X+X’).Y.Z = X.Y+X’Z+X.Y.Z+X’.Y.Z = (X.Y+X.Y.Z) + (X’Z+X’Y.Z) = X.Y (1+Z) + X’Z (1+Y) = X.Y.1+X’Z.1 = X.Y+X’Z = RHS

Prove algebraically: X’Y’Z’+X’Y’Z+X’YZ+ X’YZ’+XY’Z’+XY’Z = X’+Y’

Ans. LHS= X’Y’Z’+X’Y’Z+X’YZ+ X’YZ’+XY’Z’+XY’Z = X’Y’ (Z’+Z) +X’Y (Z+Z’) +XY’ (Z’+Z) = X’Y’.1 + X’Y + XY’ = X’ (Y’+Y) + XY’ = X’.1 + XY’ = X’+XY’ = (X’+X). (X’+Y’) = 1. (X’+Y’) = X’+Y’=RHS

State and verify involution law.

Ans. This states that (X’)’=XX X’ (X’)’0 1 01 0 1

Algebraic Prove:

(X’)’= (X’)’+0 = (X’)’+ (X. X’) (Using law of complementarity) = (X’)’+X. (X’)’+ X’ (By Distributive law) = (X’)’+X. 1 (Using law of complementarity) = (X’)’+X. 1 (Identity element) ----------- (i)And (X’)’ = (X’)’.1 (Identity element) = (X’)’. (X+X’) (Identity element) = (X’)’.X+ (X’)’.X’ (Using Distributive property) = (X’)’.X +0 (Using law of complementarity)

Page 58: Web viewAns: Message switching: The source computer sends data message to the switching office, which stores data in abuffer.It then looks for a free link to

= (X’)’.X (Identity element) ----------- (ii)From (i) and (ii) (X’)’= (X’)”+X = (X’)’.X +X Using (ii) = X+ X. (X’)’ (By Commutative law) = X (Using X+ X.Y= X)

State and verify De-Morgan’s law.

Ans. This states that: (i) (X+ Y)’ = X’. Y’ (ii) (X.Y)’ = X” + Y’

By the Truth Table

X Y X+Y (X+Y)’ X’ Y’ X’. Y’0 0 0 1 1 1 10 1 1 0 1 0 01 0 1 0 0 1 01 1 1 0 0 0 0

So by the Truth Table (X + Y)’= X’.Y’Algebraic Proof:(X+Y)’ = X’. Y’ We know that X+X’ =1 X.X’ = 0 So, (X+Y) + X’.Y’ = (X+Y+X’) . (X+Y+Y’) (By using distributive law) = (X+X’) + Y. X+ (Y + Y’) (By using commutative law) = (1+Y). (X+1) (By using X+X’=1) = 1. 1 (1+Y=1) = 1So we can prove in same way second law.

State and prove Absorption law algebraically.

Ans. Absorption law states that:(i) X+X.Y =X

Page 59: Web viewAns: Message switching: The source computer sends data message to the switching office, which stores data in abuffer.It then looks for a free link to

(ii) X.(X+Y) =X(i) LHS= X+X.Y = X.1+X.Y (X.1 = X)

= X. (1+Y) (Using Distributive property) =X.1 (X+1=1) = X (X.1=X)Now,

(ii) LHS = X.(X+Y) = X.X+X.Y (Using distributive property) = X+X.Y (X.X=X) = X. (1+Y) (Using distributive property)

= X.1 (X+1=1) =X

State the distributive law and verify the law using Truth Table.

Ans. Distributive law states that:

(i) X+ (Y.Z) = (X+Y). (X+Z)(ii) X. (Y+Z) = (X.Y) + (X.Z)

X Y Z X.Y

X.Z

Y.Z

X + Y.Z

X+Y

X+Z

Y+Z

(X+Y). (X+Z)

X. (Y+Z)

X.Y+X.Z

0 0 0 0 0 0 0 0 0 0 0 0 00 0 1 0 0 0 0 0 1 1 0 0 00 1 0 0 0 0 0 1 0 1 0 0 00 1 1 0 0 1 1 1 1 1 1 0 01 0 0 0 0 0 1 1 1 0 1 0 01 0 1 0 1 0 1 1 1 1 1 1 11 1 0 1 0 0 1 1 1 1 1 1 11 1 1 1 1 1 1 1 1 1 1 1 1

From 7th and 11th Columns X+ (Y.Z) = (X+Y). (X+Z) And form 12th and 13th Col. X. (Y+Z) = (X.Y) + (X.Z)

Prove Algebraically: (a’+b’). (a’ + b). (a + b’) = a’. b’Ans. LHS = (a’+b’). (a’ + b). (a + b’) = (a’ + b.b’) . (a+b’)

Page 60: Web viewAns: Message switching: The source computer sends data message to the switching office, which stores data in abuffer.It then looks for a free link to

=(a’+0).(a+b’) = a’.(a+b’) = a’.a + a’.b’ =0 + a’b’ = a’b’ = RHS

Write the POS form of a Boolean function F, which is represented by the following truth table:

X Y Z F0 0 0 10 0 1 10 1 0 00 1 1 11 0 0 01 0 1 11 1 0 01 1 1 0

The last col. of the truth table gives the value of F. For each occurrence of 0 in this column we get a Maxterm corresponds to that row.

Thus F = (X+Y’+Z). (X’’+Y+Z). (X’+Y’+Z). (X’+Y’+Z’)

Write the POS form of a Boolean function F (U, V, W) which is represented in a truth table as follows:

U V W F0 0 0 00 0 1 00 1 0 10 1 1 01 0 0 11 0 1 01 1 0 11 1 1 1

Page 61: Web viewAns: Message switching: The source computer sends data message to the switching office, which stores data in abuffer.It then looks for a free link to

Ans. From the above the table: F= (U+V+W). (U+V+W’). (U+V’+W’).(U’+V+W’)-

Write the POS form the following truth table:

X Y Z F0 0 0 00 0 1 10 1 0 10 1 1 01 0 0 11 0 1 01 1 0 01 1 1 1

Ans. Form the given table:F= (X+Y+Z). ( X+Y’+Z’). (X’+Y+Z’).(X’+Y’+Z)

Write the SOP form from the following table:

A B C F0 0 0 10 0 1 00 1 0 00 1 1 11 0 0 01 0 1 01 1 0 11 1 1 1

Ans. The last col. of the truth table gives the value of F for each occurrence of 1’s in this col. we get a Minterm correspond to that row. So thatF = A’B’C’+A’BC+ABC’+ABC

Write the SOP form from the following table:

Page 62: Web viewAns: Message switching: The source computer sends data message to the switching office, which stores data in abuffer.It then looks for a free link to

X Y Z F0 0 0 00 0 1 10 1 0 10 1 1 01 0 0 11 0 1 01 1 0 01 1 1 1

Ans. Form the truth table: F = X’Y’Z+X’YZ’+XY’Z’+XYZ

Reduce the following Boolean expression using K-map:F (A, B, C, D) = Ω (0, 1, 2, 3, 4, 5, 10, 11, 15)

Ans.

CD

ABC+D C+D’ C’+D’ C’+D

A+B 0 0 0 0

A+B’ 0 0 1 1

A’+B’ 1 1 0 1

A’+B 1 1 0 0

So by the K-map:F(A,B,C,D)= (A+C).(B+C’).(A’+C’+D’)

Page 63: Web viewAns: Message switching: The source computer sends data message to the switching office, which stores data in abuffer.It then looks for a free link to

Reduce the following Boolean expression using K-map:F(A,B,C,D) = ∑ (2,3,6,10,11,14)

CDAB

C’D’ C’D CD CD’

A’B’ 0 0 1 1

A’B 0 0 0 1

AB 0 0 0 1

AB’ 0 0 1 1

What are repeaters ?

Ans: Repeater is used to regenerate data and voice signals when they become weaker before reaching destination node. Repeater reads the incoming packet and amplifies it and transmits to another segment of the network.

What do you understand by Backbone of a network ?

Ans: When we connect number of LANs to form one WAN, the network which is used as a backbone to connect the LANs is called backbone network.

Page 64: Web viewAns: Message switching: The source computer sends data message to the switching office, which stores data in abuffer.It then looks for a free link to

What are Routers ?

Ans: Routers are devices that connects two networks- frequently over large distances. It understands one or more network protocols, such as IP or IPX. A Router accepts packets on at least two network interfaces, and forwards packets from one interface to another.

What is the purpose of using MODEM ?

Ans: The MODEM is used to convert digital data into analog form and vice versa.

What is a Bridge ?

Ans: A Bridge is used to connect two LANs, which are physically separated but logically same.

Mention the difference between Circular and Star topologies in networking.

Ans: The Circular Topology: Short cable length. In circular topology less connections will be needed which increase network reliability.The amount of cable needed in this topology is comparable to bus and small relative to star topology. The Star Topology has one device per connection and long cable length.

What is NFS?

Ans : NFS[Network File Systems] allows computers to share files acrossa network or networks.NFS is computer-independent and is also independent of lower layer, such as the transport layer, because it rests above the RPC[Remote Procedure Calls].

Page 65: Web viewAns: Message switching: The source computer sends data message to the switching office, which stores data in abuffer.It then looks for a free link to

Write one advantage and one disadvantage of BUS topology.

Ans: Advantages of BUS Topology: Short cable length-because there is single common data path connecting all nodes. Disadvantage of BUS Topology: Fault diagnosis is difficult- Although the bus topology is very simple, but in this topology fault detection is very difficult.

Compare coaxial and optical fiber cable ?

Ans: Coaxial Cable: It consisits of a solid wire core surrounded by one or more foil or braided wire shields, each separated from the other by some kind of plastic insulator.It is mostly used in the cable wires.Optical Fibre cable: It consists of thinn strands of glass-line material which are so connected that they carry light from source at one end to destination at the other end. The main advantage of this cable is their complete immunity to noise. But this cable is very expensive as compared to the coaxial cable.

Write the following abbreviations in their full form:FTP,WAN,SMS

Ans: FTP-File Transfer Protocol

WAN- Wide Area NetworkSMS- Short Message Service

What is gateway ?

Ans: Gateway:- The special machine, which allows different electronic networks to talk to Internet that uses TCP/IP, is called Gateway.

What is Firewall ?

Page 66: Web viewAns: Message switching: The source computer sends data message to the switching office, which stores data in abuffer.It then looks for a free link to

Ans: A Firewall is a computer system or group of computer systems that reinforce information security between two networks.These networks are referred to as an internal network and an outside network.

What is the difference between Message Switching Technique and Packet Switching Technique?

Ans: Message switching: The source computer sends data message to the switching office, which stores data in abuffer.It then looks for a free link to another switching office and sends data to that office.This process continues until data is delivered to the destination computer. This type of switching technique is also known as ‘Store and forward switching’. Packet switching: A fixed size of packet that can be transmitted across the network is specified.All the packets are stored in the main memory instead of disk.As a result accessing time of packets is reduced.

The Great Brain Organisation has set up its new branch at Srinagar for its office and web based activities .It has 4 wings of buildings as shown in diagram:

Center to center distances between various blocks

Wing X to Wing Z 50mWing Z to Wing Y 70mWing Y to Wing X 125mWing Y to Wing U 80m Wing X to Wing U 175mWing Z to Wing U 90m

Number of Computers Wing X 50Wing Z 30

Wing X

Wing Z Wing Y

Wing U

Page 67: Web viewAns: Message switching: The source computer sends data message to the switching office, which stores data in abuffer.It then looks for a free link to

Wing Y 150Wing U 15

i. Suggest a most suitable cable layout of connection between the Wings and topology.

ii. Suggest the most suitable place i.e Wings to house the server of this organization with a suitable reason with justification.

iii. Suggest the placement of the following devices with justification:a. Repeaterb. Hub/Switch

iv The organization is planning to link its head office situated in Delhi with the offices at Srinagar. Suggest an economic way to connect it; The company is ready to compromise on the speed of connectivity. Justify your answer.

Ans: i. Wing Xii.Wing Y as it has larger number of computers.iii. [1] Repeater: It is used if the distances higher than 70m. It regenerate

data and voice signals.[2] Hub/Switch. It is better to place in every building. The maximum

distance covered by an active hub is about 2000 ft. iv . TCP/IP Dial Up or Telephone Link or Microwave or Radio Link/ Radio Wave or Satellite Link or WAN.

Global Village Enterprise has following four buildings in Hyderabad city.\

Shows distances [ ] Shows computers in each building

[ 35] [80]

[ 60] [25]

Computers in each building are networked but buildings are not networked so far. The company ha snow decided to connect buildings also.

(a) Suggest a cable layout for these building.

GV1

GV3

GV2

GV4

Page 68: Web viewAns: Message switching: The source computer sends data message to the switching office, which stores data in abuffer.It then looks for a free link to

(b) In each of the buildings, the management wants that each LAN segment gets a dedicated bandwidth. i.e. bandwidth must not be shared. How can this be achieved?

(c) The company also wants for make available shared Internet access for each of the building. How can this be achieved?

(d) The company wants to link its head office in GV1 building to its another office in Japan.1. Which type of transmission medium is appropriate for such link?2. What type of network would this connection result into?

Ans:- (a) The suggested cable layout is:

(The total cable length required for this layout : 75 mtrs)

(b) To give dedicated bandwidth, the computers in each builing should be connected via Switches a switches offer dedicated bandwidths.

(c) By installing routers in each building, shared Internet access can be made possible.

(d) 1. Satellite as it can connect offices across globe2. WAN (Wide Area Network)

“China Middleton Fashion” is planning to expand their network in India, starting with two cities in India to provide infrastructure for distribution of their product. The company has planned to setup their main office in Chennai at three different locations and have named their offices as “Production Unit” and “Media Unit”. The company has its corporate unit in Delhi. A rough layout of the same is as follows:

GV1

GV2 GV4

GV3

Page 69: Web viewAns: Message switching: The source computer sends data message to the switching office, which stores data in abuffer.It then looks for a free link to

Approximate distance between these Units is as follows:

From To DistanceProduction Unit Finance Unit 70 MTR.Production Unit Media Unit 15KMProduction Unit Corporate Unit 2112KMFinance Unit Media Unit 15KM

In continuation of the above, the company experts have planned to install the following number of computers in each of their offices:

Production Unit 150Finance Unit 35Media Unit 10Corporate Unit 30

(i) Suggest the kind of network required(out of LAN, MAN, WAN) for connecting each of the following office units:

Production Unit Media Unit

(ii) Which one of the following devices will you suggest for connecting all the computers within each of their office units? Switch / Hub Modem Telephone

(iii) Which of the following communication media, you will suggest to be procured by the company for connecting their local office units in Chennai for very effective(High Speed) Communication?

Chennai

INDIA Corporate unit(Delhi) Produc

tion unit

Finance unitMedia

unit

Page 70: Web viewAns: Message switching: The source computer sends data message to the switching office, which stores data in abuffer.It then looks for a free link to

Telephone Cable Optical Fibre Ethernet Cable

(iv) Suggest a cable/wiring layout for connecting the company’s local office units located in Chennai. Also, Suggest an effective method/technology for connecting the company’s office unit located in Delhi.

Answer: (i) Production Unit and Media Unit- MAN

Production Unit and Finance Unit- LAN(ii) Switch/Hub(iii) Optical Fibre

(iv) Suggested layout:

To connect to Delhi office – Satellite

What do you understand by the terms Cookies ?

Ans: Cookies : It is a small file that a Web server can store on your machine. Its purpose is to allow a Web server to personalize a Web page, depending on whether you have been to the Web site before and what you may have told it during previous sessions.

Which of the following unit measures the speed with which data can be transmitted from one node to another node of a network ? Also, give the expansion of the

Production Unit

Finance unit

Media unit

Page 71: Web viewAns: Message switching: The source computer sends data message to the switching office, which stores data in abuffer.It then looks for a free link to

suggested unit.MbpsKMphMGps

Ans: Mbps- is the unit measured the speed with which data can be transmitted from one node to another node of a network. Mbps stands for Megabytes per second.

What is Mosaic used for?

Ans: MOSAIC is a program for cruising the Internet.

Define Server.

Ans:- The node providing servise to whole network and which is at a fixed address is called server.

What is Packet?

Ans: When data is transferred from one node to other. It is divided into small parts are called packets.

Define WAIS.

Ans: Wide Area Information Server.

What is the function of TELNET ?

Ans: Telnet is an Internet facility that facilitates remote login. Remote login is the process of accessing a network from remote place without actually being at that place of working.

Page 72: Web viewAns: Message switching: The source computer sends data message to the switching office, which stores data in abuffer.It then looks for a free link to

Define Baud.

Ans: A baud is a data transmission rate of one bit per second.

What is Home page?

Ans: A home page contains details about a particular entity.For example: the company and its structure etc.

Expand the following terminologies:TCP/IPXMLCDMAWLLSMTPPOPGSMSIM

Ans:- TCP/IP- Transmission Control Protocol/Internet ProtocolXML - Extensive Markup LanguageCDMA- Code Division Multiple AccessWLL -Wireless in Local LoopSMTP- Simple Mail Transfer ProtocolPOP - Post Office ProtocolGSM - Global System MobileSIM - Subscribers Identification Module

What is Client Server architecture?

Ans:- TO designate a particular node which is well known and fixed address, to provide a service to the network as a whole. The node providing the service is known as the server and the nodes that use that services are called as clients of that server. This type of network is called client server model.

Page 73: Web viewAns: Message switching: The source computer sends data message to the switching office, which stores data in abuffer.It then looks for a free link to

Define Simplex, Full Duplex and Half Duplex.

Ans:- Simplex: In this mode, data is always transferred in only one direction.Full Duplex: In this mode, data can be transferred in both direction simultaneouslyHalf Duplex: In this mode, data can be transferred in both direction but not simultaneously

What is 80-20 rule of network design?

Ans:- the 80-20 rule of network says that : 80% of the traffic on a given network segment should be local and not more than 20% of the network traffic should need to move across a backbone. i.e. the spine connecting various networks.

Define the following termsVideo ConferencingTelnetFirewallCookiesCyber LawHackerCracker

Video Conferencing.two way videophone conversation among multiple

participants is known as video conferencing.

Telnet.it is an Internet utility used used for remote login.

Firewall. A Firewall is aa system designed to prevent unauthorized access to or

from a private network.

Cookies. Cookies are the messages that a web server transmitter to a web

borrowers so that the web server can keep track of the user activity on a specific

website.

Page 74: Web viewAns: Message switching: The source computer sends data message to the switching office, which stores data in abuffer.It then looks for a free link to

Cyber Law. All legal and regulerltory aspects of Internet and WWW are define

the Cyber Law.

Crackers. Malicious programmers who break into secure system are called

Crackers.

Hackers.Programers to gain knowledge about computer system for play full

pranks are knows as Hackers.

****************BEST OF LUCK

*****************