Advertisements
Advertisements
The following C++ code during compilation reports errors as follows:
Error: 'ofstream' not declared
Error: 'strupr' not declared
Error: 'strcat' not declared
Error: 'FIN' not declared
Write the names of the correct header files, which must be included to compile the code successfully
void main()
{
of stream FIN ("WISH. TXT") ;
char TEXT2[]="good day";
char TEXTl []="John! ";
strupr(TEXT2);
strcat(TEXTl , TEXT2);
FIN<<TEXTl<Concept: undefined >> undefined
Anil typed the following C++ code and during compilation, he found three errors as follows :
1) Function strlen should have a prototype
2) Undefined symbol cout
3) Undefined symbol endl
On asking, his teacher told him to include necessary header files in the code. Write the names of the header files, which Anil needs to include, for successful compilation and execution of the following code:
void main()
{
char Txt[] = "Welcome";
for(int C= 0; C<strlen(Txt); C++)
Txt[C] = Txt[C]+ 1;
cout<<Txt<<endl;
}Concept: undefined >> undefined
Advertisements
Ms Raveena Sen is an IT expert and a freelancer. She recently used her skills to access the Admin password for the network server of Super Dooper Technology Ltd. and provided confidential data of the organization to its CEO, informing him about the vulnerability of their network security. Out of the following options (i) to (iv), which one most appropriately defines Ms Sen?
Justify the reason for your chosen option :
1) Hacker
2) Cracker
3) Operator
4) Network Admin
Concept: undefined >> undefined
Out of the following, which all comes under cyber crime ?
1) Stealing away a brand new hard disk from a showroom
2) Getting in someone's social networking account without his consent and posting on his behalf
3) Secretly copying data from server of an organization and selling it to the other organization.
4) Looking at online activities of a friends blog.
Concept: undefined >> undefined
Observe the following program very carefully and write the names of those header files (s), which are essentially needed to compile and execute the following program successfully :
typedef char STRING[80];
void main()
{
STRING Txt[] ="We love Peace";
int Count=O;
while(Txt[Count]!='\0')
if (isalpha(Txt[Count]))
Txt[Count++]='@';
else
Txt[Count++]='#';
puts(Txt);
}Concept: undefined >> undefined
Write function definition for TOWER() in C++ to read the content of a text file WRITEUP.TXT, count the presence of word TOWER and display the number of occurrences of this word.
Note:
- The word TOWER should be an independent word
- Ignore type cases (i.e. lower/upper case)
Example:
If the content of the file WRITEUP.TXT is as follows:
| Tower of hanoi is an interesting problem. Mobile phone tower is away from here. Views from EIFFEL TOWER are amazing. |
The function TOWER( ) should display the following :
| 3 |
Concept: undefined >> undefined
Look at the following C++ code and find the possible output from the options (i) to (iv) following it. Also, write the highest and lowest values that can be assigned to the array A.
Note:
- Assume all the required header files are already being included in the code
- The function random(n) generates an integer between 0 and -1
void main()
{
randomize();
int A(4], C;
for(C=0; C<4; C++)
A(C] = random(C+l) + 10;
for (C=3; C >= 0; c--)
cout<<A(C]<<"@";
}
1) 13@10@11@10@
2) 15$14$12$10$
3) 12@11@13@10@
4) 12@11@10@10@
Concept: undefined >> undefined
Find and write the output of the following C++ program code :
Note : Assume all required header files are already being included in the program.
void main()
{
int *Point, Score[]={100,95,150 , 75 , 65, 120};
Point = Score;
for(int L = 0; L<6; L++)
{
if((*Poi nt)%10==0)
*Point /= 2;
else
*Point -= 2;
if((*Point) %5==0)
*Point /= 5;
Point++;
}
for(int L = 5; L>=O; L--)
cout<<Score[L]<<"*";
}Concept: undefined >> undefined
Write the definition of a function AddUp(int Arr[], int N) in C++, in which all even positions (i.e., 0,2,4, ... ) of the array should be added with the content of the element in the next position and odd positions (i.e., 1,3,5, ... ) elements should be incremented by 10
Example: if the array Arr contains
| 23 | 30 | 45 | 10 | 15 | 25 |
Then the array should become
| 53 | 40 | 55 | 20 | 40 | 35 |
Note:
- The function should only alter the content in the same array.
- The function should not copy the altered content in another array.
- The function should not display the altered content of the array.
- Assuming, the Number of elements in the array are Even.
Concept: undefined >> undefined
Write a definition for a function SUMMIDCOL(int MATRIX [10], int N, int M) in C++, which finds the sum of the middle column's elements of the MATRIX (Assuming N represents a number of rows and M represents the number of columns, which is an odd integer).
Example: If the content of array MATRIX having N as 5 and M as 3 is as follows
| 1 | 2 | 1 |
| 2 | 1 | 4 |
| 3 | 4 | 5 |
| 4 | 5 | 3 |
| 5 | 3 | 2 |
The function should calculate the sum and display the following :
Sum of Middle Column: 15
Concept: undefined >> undefined
Write the definition of a function Change(int P[], int N) in C++, which should change all the multiples of 10 in the array to 10 and rest of the elements as 1. For example, if an array of 10 integers is as follows:
| P[0] | P[1] | P[2] | P[3] | P[4] | P[5] | P[6] | P[7] | P[8] | P[9] |
| 100 | 43 | 20 | 56 | 32 | 91 | 80 | 40 | 45 | 21 |
After executing the function, the array content should be changed as follows:
| P[0] | P[1] | P[2] | P[3] | P[4] | P[5] | P[6] | P[7] | P[8] | P[9] |
| 10 | 1 | 10 | 1 | 1 | 1 | 10 | 10 | 1 | 1 |
Concept: undefined >> undefined
Polina Raj has used a text editing software to type some text in an article. After saving the article as MYNOTES.TXT, she realised that she has wrongly typed alphabet K in place of alphabet C everywhere in the article.
Write a function definition for PURETEXT() in C++ that would display the corrected version of the entire article of the file MYNOTES.TXT with all the alphabets "K" to be displayed as an alphabet "C" on screen.
Note: Assuming that MYNOTES.TXT does not contain any c alphabet otherwise
Example:
If Polina has stored the following content in the file MYNOTES.TXT
|
I OWN A KUTE LITTLE KAR I KARE FOR IT AS MY KHILD |
The function PURETEXT() should display the following content
|
I OWN A CUTE LITTLE CAR I CARE FOR IT AS MY CHILD. |
Concept: undefined >> undefined
Classify the following Web Scripting as Client-Side Scripting and Server Side Scripting
Java Scripting
Concept: undefined >> undefined
Classify the following Web Scripting as Client-Side Scripting and Server Side Scripting
ASP
Concept: undefined >> undefined
Classify the following Web Scripting as Client-Side Scripting and Server Side Scripting
VB Scripting
Concept: undefined >> undefined
Classify the following Web Scripting as Client-Side Scripting and Server Side Scripting
JSP
Concept: undefined >> undefined
