0% found this document useful (0 votes)
80 views11 pages

Revision Questions IP 09

The document contains revision questions on various topics related to C++ programming and computer networks. It includes questions on functions to search and display records from binary files based on certain criteria. Definitions are provided for functions to read objects from binary files created using classes, and display objects that meet specified conditions. Questions also cover topics like open source software, text entry methods, network devices, security threats, and functions for modifying records in a binary file.

Uploaded by

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

Revision Questions IP 09

The document contains revision questions on various topics related to C++ programming and computer networks. It includes questions on functions to search and display records from binary files based on certain criteria. Definitions are provided for functions to read objects from binary files created using classes, and display objects that meet specified conditions. Questions also cover topics like open source software, text entry methods, network devices, security threats, and functions for modifying records in a binary file.

Uploaded by

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

Revision Questions IP 09/111/2016

Q1 - Write the advantages of using Unicode to represent text?

Unicode encoding standard provides the basis for processing, storage and interchange of text data in any language in all
modern software and information technology protocols.

Q2 - Which of the following are open


source softwares ?

GNU
MS-Office
BOSS
Windows OS

Ans

GNU and BOSS

Q3 - Name the government organization that contributes to the growth of FOSS in India.

National Resource Centre for Free and Open Source Software (NRCFOSS) is the government organization that
contributes to the growth of FOSS in India.

Q4 - Read the given activities carefully and mention in front of the activity whether that activity is snooping or
eavesdropping

. Getting someone’s login information by casually


watching what he/she is typing.
ii. Setting up unauthorized parallel telephone lines
iii. Installing some software/hardware which
captures the data while on itsway.
iv. Reading the files on someone’s computer in an
unauthorized manner.

. Snooping.
ii. Eavesdropping.
iii. Eavesdropping.
iv. Snooping.

Q5 - Chanakya has to write a paragraph in English on Nobel laureates as a part of his holiday homework. He is using a
software in which he types the text in Hindi and the software automatically converts the text into English. For example, if
he types

नोबेल प्राइज इस गिवेन इन सिक्स कैटे गरीज

The software converts it into

Nobel Prize is given in six categories


What kind of text entry is it –

Phonetic text entry OR Keymap based text entry?

How is it different from the other kind of text entry?

 It is phonetic text entry.

 It is different from keymap based text entry as

in the keymap based text entry keyboard keys

are mapped to specific characters using a

keymap whereas in phonetic text entry text

translation is done by some software based

on probable pronunciation of the entered text

Q7 - What is common in all of the following

software(s) ? Firefox
Perl
PHP
OpenOffice.org

Write one feature of the above category of software.

 All are open source software.

 Mozilla firefox:- Web Browser


Perl:- Programming Language
PHP:- Server side scripting language

designed for web development.


OpenOffice:- Open-source office software

suite for word processing,

spreadsheets, presentations,

graphics, databases
• REVISION QUESTIONS NETWORKING

1. The ‘Chalchitra’ theatre has a computer network. The network is in one building. (i) Name this type of network( out of
LAN/MAN/WAN). (ii) Name one communication channel that can be used for fast communication between workstations
of the network.

i.LAN
ii. Optical fiber cable (1 mark for each correct answer)

Write on example each of URL , IP address and MAC address.

URL - http://www.cbse.nic.in/welcome.htm IP address - 122.176.185.219


Mac Address- 00:0A:95:9D:68:16.
(1 mark for each correct example)

Identify the topology shown below. Write 2 advantages of this topology.

Star Topology
Two advantages are as follows:
1. Easy to install
2. Easy to diagnose the fault
(1 mark for identifying correct topology)
(½ mark for mentioning each correct advantage)

Draw a network layout of bus topology to connect 5 client computers and 1 server computer.
(½ mark for correct network topology and ½ mark for correct no of
computers)

Mr. John wants to prevent unauthorized access to/from his company's local area
network. Write the name of a system (software/ hardware), which he should install to do the same.

• He should install Firewall.

• (1 mark for correct answer)

Kristen has typed the following text in the address bar:


http://www.cbse-international.com/help.htm
Explain to her the main concept of URL and Domain name with reference to the example given above.

• URL (Uniform Resource Locator) is the complete address of a document on the web, whereas a domain name
specifies the location of document's web server.

• A domain name is a component of the URL used to access web sites.

• For example the web address http://www.cbse-international.com/help.htm

• is a URL. In this URL www.cbse-international.com is the domain name.

• (1 mark for differentiating between URL and domain name ½ mark for correctly

• identifying url and ½ mark for correctly identifying domain name)

What is the purpose of modem in a network?

It converts/modulates digital signal to analog and analog signal to digital signal

Raj Kamal International School is planning to connect all computers, each spread over
distance within 45 meters. Suggest an economical cable type having high speed data
transfer, which can be used to connect these computers.

Raj Kamal International School is planning to connect all computers, each spread over
distance within 45 meters. Suggest a communication medium for very effective and high speed data transfer, which can
be used to connect these computers.
• Coaxial

• Optical Fibre

Identify the following devices :-

• A. an intelligent device that connects several nodes to form a network and redirects the received information
only to intended nodes.

• B. A device that regenerates (Amplifies the received signal) and re-transmits it to its destination.

• C. Anetwork device to connect two different networks together that work upon different networking models so
that the two networks can communicate properly.

• A- switch

• B- repeater

• C- Gateway

Explain in brief any 2 security threats to Computer networks.

1. Denial of service attack: It is an attempt to make one or more network resources unavailable to their legitimate users.
2. Snooping:It is gaining unauthorised access to another person’s or organization’s data.
REVISION QUESTIONS Binary Files 08/11/2016
Q1- Write a definition for function ONOFFER( ) in C++ to read each object of a binary file TOYS.DAT, find and
display details of those toys, which has status as “ON OFFER”. Assume that the file TOYS.DAT is created with the
help of objects of class TOYS, which is defined below:
class TOYS
{
int TID;char Toy[20],Status[20]; float MRP;
public:
void Getinstock()
{
cin>>TID;gets(Toy);gets(Status);cin>>MRP;
}
void View()
{
cout<<TID<<”:”<<Toy<<”:”<<MRP<<””:”<<Status<<endl;
}
char *SeeOffer(){return Status; }

Steps to search a record of a BINARY FILE :-
Open file from which data is to be searched.
Read from file
Check comparisons
If matches
In Case of Structure:- display each element using structure variable with dot operator.
In Case of Class :- call to display function.
close file.
void ONOFFER()
{
TOYS T;
ifstream fin;
fin.open(“TOYS.DAT”, ios::binary);
if(!fin)
{ cout<<“Unable to open file “;
exit(0); }
else{
while(fin.read((char*)&T, sizeof(T)))
{ if(strcmp(T.SeeOffer(),”ON OFFER”)==0)
T.View(); }
}
fin.close(); //Ignore
}
Q2 - Write a definition for function Economic() in C++ to read each
record of a binary file ITEMS.DAT, find and display those items, which costs less than 2500. Assume that the file
ITEMS.DAT is created with the help of objects of class ITEMS, which is defined
below:
class ITEMS
{
int ID;char GIFT[20]; float Cost;
public :
void Get()
{
cin>>CODE;gets(GIFT);cin>>Cost;
}
void See()
{
cout<<ID<<":"<<GIFT<<":"<<Cost<<endl;
}
float GetCost() {return Cost;}.

void Economic()
{
ITEMS I;
ifstream fin(“ITEMS.DAT”,ios::binary);
if(!fin)
{ cout<<“Unable to open file “;
exit(0); }
else{
while (fin.read((char *)&I,sizeof(I)))
{ if(I.GetCost()<2500)
I.See(); }
}
fin.close();
}
(½ Mark for opening ITEMS.DAT correctly)
(1 Mark for reading all records from the file)
(1 Mark for checking value of Cost < 2500 )
(½ Mark for displaying the desired items)
Given a binary file SPORTS.DAT, containing records of the following
structure type :
struct Sports
{
char 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”.
Steps to modify a record of a BINARY FILE :-
1. Open file from which data is to be searched.
2. Read from file
4. Check comparisons
5. If matches
In Case of Structure:- take input for each element using structure variable with dot operator.
In Case of Class :- call to member function in which data members are accepted from user.
6. Put Pointer to one position back for updating the matched record.
7. Write record taken as input again in the same binary file.
void SP2AT()
{
fstream F1,F2;
Sports S;
F1.open(“SPORTS.DAT”,ios::binary|ios::in);
F2.open(“ATHLETIC.DAT”,ios::binary|ios::out);
if(!F1)
{ cout<<“Unable to open SPORTS.DAT“;
exit(0); }
else{
while(!F1.eof())
{ F1.read((char*) &S,sizeof(S));
if(!strcmp(S.Event,”Athletics”))
F2.write((char *)&S,sizeof(S)); }
}
F1.close();
F2.close();
}
(½ Mark for opening each file in the correct mode)
(½ Mark for reading the content from the file)
(½ Mark for the correct loop)
(½ Mark for the correct comparison with “Athletics”)
(½ Mark for writing the content to the second file)
void modify()
{
fstream F1;
Employee S;
F1.open(“SPORTS.DAT”,ios::binary|ios::in);
while(!F1.eof( ))
{
F1.read((char*) &S,sizeof(S));
if(S.get_salary( )=10000))
{ S.set_salary(20000);
F1.seekp(-1*sizeof(s),ios::cur);
F1.write((char *)&S,sizeof(S));}
}
F1.close();
}
(½ Mark for opening file in the correct mode)
(½ Mark for reading the content from the file)
(½ Mark for the correct comparison)
(½ Mark for the correct salary setting )
(½ Mark for the placing pointer to correct position)
(½ Mark for writing the content back to file)
Write a function in C++ to search for a camera from a binary file "CAMERA.DAT" containing the objects of class
CAMERA (as defined below). The user should enter the Model No and the function should search and display the
details of the camera.
Class CAMERA
{
long ModelNo;
float MegaPixel;
int Zoom;
char Details[120];
Public:
Void Enter() {cin>>ModelNo>>MegaPixel>>Zoom; gets(Details);}
Void Display() { Cout<<ModelNo<<MegaPixel<<Zoom<<Details<<endl;}
Long GEtModelNo() { return ModelNo;}
};
REVISION QUESTIONS 09/11/2016
Deleting data from a binary file
One temporary file need to be created to copy all those records which are not to be deleted.
Remove the original file and rename temporary file with original file.
Write a definition for function ONOFFER( ) in C++ to read each object of a binary file TOYS.DAT delete records
,which has status as “ON OFFER”. Assume that the file TOYS.DAT is created with the help of objects of class TOYS,
which is defined below:
class TOYS
{
int TID;char Toy[20],Status[20]; float MRP;
public:
void Getinstock()
{
cin>>TID;gets(Toy);gets(Status);cin>>MRP;
}
void View()
{
cout<<TID<<”:”<<Toy<<”:”<<MRP<<””:”<<Status<<endl;
}
char *SeeOffer(){return Status; } };
(CBSE 2016 OUTSIDE DELHI)
STEPS TO DELETE RECORD FROM A BINARY FILE :-
1. Open file from which data is to be deleted.
2.Open a temporary file .
for copying all those which are not to be
deleted.
3. Read from first file
4. do comparisons
5. write in to temporary file which are not to be deleted
6. close both files.
7. remove first file
8. rename temporary file with previous files name.
void ONOFFER()
{
TOYS T;
ifstream fin (“TOYS.DAT”, ios::binary);
ofstream fout(“temp.dat”,ios::binary);
if( !fin) { cout<<“\n TOYS.DAT could nor be opened”; exit(0) };
else { while(fin.read((char*)&T, sizeof(T)))
{ if(!strcmp(T.SeeOffer(),”ON OFFER”)==0)
fout.write((char*)&T, sizeof(T)) }
fin.close();
fout.close();
remove(“TOYS.DAT”);
rename(“temp.dat”,”Toys.dat”);
}
}
(1Mark for opening both files correctly)
(½ Mark for reading records from TOYS.DAT)
(½ Mark for comparison statement)
(½ Mark for writing data in temp file)
(1 Mark for removing and renaming files)
Following is the structure of each record in a data file named PRODUCT.DAT.
struct PRODUCT
{ char Product_Code[10] ; char Product_Description[10] ;
int Stock ;
};
Write a function in C++ to delete a record form the file for a particular value of Stock. The Stock , whose data is to
be deleted, is passed as argument to function.
(CBSE 2006 OUTSIDE DELHI)
void ONOFFER( int st)
{
PRODUCT T;
ifstream fin (“PRODUCT.DAT”, ios::binary);
ofstream fout(“temp.dat”,ios::binary);
if( !fin) { cout<<“\n PRODUCT.DAT could nor be opened”;
exit(0) };
else { while(fin.read((char*)&T, sizeof(T)))
{ if(T.Stock)!=st)
fout.write((char*)&T, sizeof(T)) }
fin.close();
fout.close();
remove(“PRODUCT.DAT”);
rename(“temp.dat”,” PRODUCT.dat”);
} }
(1Mark for opening both files correctly) (½ Mark for reading records from PRODUCT.DAT)
(½ Mark for comparison statement) (½ Mark for writing data in temp file)
(1 Mark for removing and renaming files)
Write a function in C++ to search for a camera from a binary file "CAMERA.DAT" containing the objects of class
CAMERA (as defined below). The user should enter the Model No and the function should search and delete camera
detail.
class CAMERA
{
long ModelNo;
float MegaPixel;
int Zoom;
char Details[120];
Public:
Void Enter() {cin>>ModelNo>>MegaPixel>>Zoom; gets(Details);}
Void Display() { Cout<<ModelNo<<MegaPixel<<Zoom<<Details<<endl;}
Long GEtModelNo() { return ModelNo;}
};

You might also like