हिंदी

Science (English Medium) कक्षा १२ - CBSE Question Bank Solutions for Computer Science (C++)

Advertisements
[object Object]
[object Object]
विषयों
मुख्य विषय
अध्याय
Advertisements
Advertisements
Computer Science (C++)
< prev  61 to 76 of 76  next > 

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<
[6] Object Oriented Programming in C++
Chapter: [6] Object Oriented Programming in C++
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;
}
[6] Object Oriented Programming in C++
Chapter: [6] Object Oriented Programming in C++
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

[1] Networking and Open Source Software
Chapter: [1] Networking and Open Source Software
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.

[1] Networking and Open Source Software
Chapter: [1] Networking and Open Source Software
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);
}
[6] Object Oriented Programming in C++
Chapter: [6] Object Oriented Programming in C++
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
[6] Object Oriented Programming in C++
Chapter: [6] Object Oriented Programming in C++
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@

[6] Object Oriented Programming in C++
Chapter: [6] Object Oriented Programming in C++
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]<<"*";
}
[6] Object Oriented Programming in C++
Chapter: [6] Object Oriented Programming in C++
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.
[6] Object Oriented Programming in C++
Chapter: [6] Object Oriented Programming in C++
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

[6] Object Oriented Programming in C++
Chapter: [6] Object Oriented Programming in C++
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

 

[6] Object Oriented Programming in C++
Chapter: [6] Object Oriented Programming in C++
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.

[6] Object Oriented Programming in C++
Chapter: [6] Object Oriented Programming in C++
Concept: undefined >> undefined

Classify the following Web Scripting as Client-Side Scripting and Server Side Scripting

Java Scripting

[1] Networking and Open Source Software
Chapter: [1] Networking and Open Source Software
Concept: undefined >> undefined

Classify the following Web Scripting as Client-Side Scripting and Server Side Scripting

ASP

[1] Networking and Open Source Software
Chapter: [1] Networking and Open Source Software
Concept: undefined >> undefined

Classify the following Web Scripting as Client-Side Scripting and Server Side Scripting

VB Scripting

[1] Networking and Open Source Software
Chapter: [1] Networking and Open Source Software
Concept: undefined >> undefined

Classify the following Web Scripting as Client-Side Scripting and Server Side Scripting

JSP

[1] Networking and Open Source Software
Chapter: [1] Networking and Open Source Software
Concept: undefined >> undefined
< prev  61 to 76 of 76  next > 
Advertisements
Advertisements
CBSE Science (English Medium) कक्षा १२ Question Bank Solutions
Question Bank Solutions for CBSE Science (English Medium) कक्षा १२ Biology
Question Bank Solutions for CBSE Science (English Medium) कक्षा १२ Chemistry
Question Bank Solutions for CBSE Science (English Medium) कक्षा १२ Computer Science (C++)
Question Bank Solutions for CBSE Science (English Medium) कक्षा १२ Computer Science (Python)
Question Bank Solutions for CBSE Science (English Medium) कक्षा १२ English Core
Question Bank Solutions for CBSE Science (English Medium) कक्षा १२ English Elective - NCERT
Question Bank Solutions for CBSE Science (English Medium) कक्षा १२ Entrepreneurship
Question Bank Solutions for CBSE Science (English Medium) कक्षा १२ Geography
Question Bank Solutions for CBSE Science (English Medium) कक्षा १२ Hindi (Core)
Question Bank Solutions for CBSE Science (English Medium) कक्षा १२ Hindi (Elective)
Question Bank Solutions for CBSE Science (English Medium) कक्षा १२ History
Question Bank Solutions for CBSE Science (English Medium) कक्षा १२ Informatics Practices
Question Bank Solutions for CBSE Science (English Medium) कक्षा १२ Mathematics
Question Bank Solutions for CBSE Science (English Medium) कक्षा १२ Physical Education
Question Bank Solutions for CBSE Science (English Medium) कक्षा १२ Physics
Question Bank Solutions for CBSE Science (English Medium) कक्षा १२ Political Science
Question Bank Solutions for CBSE Science (English Medium) कक्षा १२ Psychology
Question Bank Solutions for CBSE Science (English Medium) कक्षा १२ Sanskrit (Core)
Question Bank Solutions for CBSE Science (English Medium) कक्षा १२ Sanskrit (Elective)
Question Bank Solutions for CBSE Science (English Medium) कक्षा १२ Sociology
Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×