Science (English Medium) Class 12 - CBSE Question Bank Solutions for Computer Science (C++)

Advertisements
Subjects
Topics
Subjects
Popular subjects
Topics
Advertisements
Advertisements
Computer Science (C++)
< prev  1 to 20 of 97  next > 

Write the type of C++ token (keywords) and the User-defined identifier from the following.

1) else

2) Long

3) 4Queue

4) _count

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

Rewrite the following C++ code after removing any/all syntactical error with each correction underline

Note: Assume all required header files are already included in the program.

Typedef Count(int);
void main()
(
    Count C;
    cout<<"Enter the count:";
    cin>>C;
    for (K = 1 ; K<=C;K++)
        cout<< C "*" K <<end1;
}
[6] Object Oriented Programming in C++
Chapter: [6] Object Oriented Programming in C++
Concept: Concept of Object Oriented Programming in C++

Advertisements

Find and write the output of the following C++ program code:

Note: Assume all required header files are already included in the program:

#define Modify(N) N*3+10
void main()
(
    int LIST(]:{l0,15,12,17);
    int *P-LIST, C;
    for(C=3; C>=O; C--)
        LIST[c]=Modify(LIST[c) ;
    for (C=O; C<=3; C++)
    {
        cout<<*P<<":";
        P++;
    }
}
[7] Data Structures
Chapter: [7] Data Structures
Concept: Introduction to Data Structure - Array, Stack Queues Primitive and Non-primitive Data Structure

Write the type of C++ tokens (keywords and user-defined identifiers) from the following:

1) new

2) While

3) case

4) Num_2

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

Rewrite the following C++ code after removing any/all syntactical errors with each correction underlined.

Note: Assume all required header files are already being included in the program.

void main()
{
     cout<<"Enter an Alphabet:" ;
     cin>>CB ;
     switch(CH)
     case 'A' · cout<<"Ant"; Break ;
     case 'B' · cout<<"Bear"; Break;
}
[6] Object Oriented Programming in C++
Chapter: [6] Object Oriented Programming in C++
Concept: Concept of Object Oriented Programming in C++

Find the correct identifiers out of the following, which can be used for naming Variable, Constants or Functions in a C++ program.

For, while, INT, NeW, delete, lstName, Add+Subtract, namel

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

Observe the following C++ code very carefully and rewrite it after removing any/all syntactical errors with each correction underlined.

Note: Assume all required header files are already being included in the program

#Define float MaxSpeed=60.5;
void main()
{
   int MySpeed
   char Alert='N';
   cin>>MySpeed;
   if MySpeed>MaxSpeed
    Alert='Y';
    cout<<A1ert<<endline;
}

 

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

Write the output of the following C++ program code :

Note: Assume all required header files are already being included in the program.

void Location(int &X,int Y=4)
{
   Y+=2;
   X+=Y;
}
void main()
{
   int PX=l0,PY=2;
   Location(PY);
   cout<<PX<<","<<PY<<endl;
   Location(PX,PY);
   cout<<PX<<", "<<PY<<endl;
}
[6] Object Oriented Programming in C++
Chapter: [6] Object Oriented Programming in C++
Concept: Concept of Object Oriented Programming in C++

Write the output of the following C++ program code:

Note: Assume all required header files are already being included in the program.

class Eval
{
   char Level;
   int Point;
public:
   Eval(){Level='E'; Point=O;}
   void Sink(int L)
   {
      Level~=L;
   }
   void Float(int L)
   {
      Level+=L;
      Point++;
   }
   void Show()
   {
      cout<<Level<<"#"<<Point<<endl;
   }
};

void main ()
{
   Eval E;
   E.Sink(3);
   E.Show();
   E.Float(7);
   E.Show();
   E.Sink(2);
   E.Show();
}
[6] Object Oriented Programming in C++
Chapter: [6] Object Oriented Programming in C++
Concept: Concept of Object Oriented Programming in C++

Study the following program and select the possible output(s) from the options (i) to (iv) following it. Also; write the maximum and the minimum values that, can be ·assigned to the variable VAL

Note:

-Assume all required header files are already being included in the program.

- random(n) function generates all integer 6, and n-1.

void main ()
{
   randomize();
   int VAL;
   VAL=random(3)+2;
   char GUESS[] ="ABCDEFGHIJK";
   for(int I = 1, I = 1;I <= VAL; I++)
   {
      for (int J=VAL; J<= 7; J++)
      cout<<GUESS[J];
      cout<<endl;
   }
}

1) 

2)

3)

4)

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

Observe the following table carefully and· write the names of the most appropriate columns, which can be considered as (i) candidate keys and. (ii) primary key:

Code Item Qty Price Transaction Date
1001 Plastic Folder 14" 100 3400 2014-12-14
1004 Pen Stand Standard 200 4500 2015-01-31
1005 Stapler Mini 250 1200 2015-02-28
1009 Punching Machine Small 200 1400 2015-03-12
1003 Stapler Big 100 1500 2015-02-02
[8] Database Management Systems and SQL
Chapter: [8] Database Management Systems and SQL
Concept: Introduction to Data Base Concepts and Its Need in C++

Observe the following tables VIDEO and MEMBER carefully and write the name of the RDBMS operation out of (i) SELECTION (ii) PROJECTION (iii) UNION (iv) CARTESIAN PRODUCT, which has been used to produce the output as shown below. Also, find the
Degree and Cardinality of the final result.

TABLE: VlDEO

VNO VNAME TYPE
F101 The Last Battle Fiction
C101 Angels and Devils Comedy
A102 Daredevils Adventure

TABLE: MEMBER

MNO MNAME
M101 Namish Gupta
M102 Sana Sheikh
M103 Lara James

TABLE: FINAL RESULT

VNO VNAME TYPE MNO MNAME
F101 The Last Battle Fiction M101 Namish Gupta
F101 The Last Battle Fiction M102 Sana Sheikh
F101 The Last Battle Fiction M103 Lara James
C101 Angels and Devils Comedy M101 Namish Gupta
C101 Angels and Devils  Comedy M102 Sana Sheikh
C101 Angels and Devils  Comedy M103 Lara James
A102 Daredevils Adventure M101 Namish Gupta
A102 Daredevils Adventure M102 Sana Sheikh
A102 Daredevils Adventure M103 Lara James

 

[8] Database Management Systems and SQL
Chapter: [8] Database Management Systems and SQL
Concept: Relational Data Model

What kind of data gets stored in cookies and how is it useful ?

[10] Networking and Open Source Software
Chapter: [10] Networking and Open Source Software
Concept: Internet

Write the definition of a function SumEO(int VALUES[], int N) in C++, which should display the 4 sum of even value and sum of odd values of the array separately.

Example: If the array VALUES contains

25 20 22 21 53

Then the functions should display the output as:

Sum of even values = 42 (i.e., 20+22)

Sum of odd values= 99 (i.e., 25+21+53)

[7] Data Structures
Chapter: [7] Data Structures
Concept: One and Two Dimensional Arrays - Sequential Allocation and Address Calculation

Write a definition for a function UpperHalf(int Mat[4][4]) in C++ which displays the elements in the same way as per the example is shown below.

For example, if the content of the array Mat is as follows:

25 24 23 22
20 19 18 17
15 14 13 12
10 9 8 7

Thew function should display the content in the following format:

[7] Data Structures
Chapter: [7] Data Structures
Concept: One and Two Dimensional Arrays - Sequential Allocation and Address Calculation

Let us assume Data[20][15] is a two-dimensional array, which is stored in the memory along the row with each of its elements occupying 2 bytes. Find the address of the element Data(10][5], if the element Data[10][l5] is stored at the memory location 15000.

[7] Data Structures
Chapter: [7] Data Structures
Concept: One and Two Dimensional Arrays - Sequential Allocation and Address Calculation

Write SQL queries for (i) to (iv) and find outputs for SQL queries (v) to (viii) which are based on the table.

TABLE: Account

ANO ANAME ADDRESS
101 Nirja Singh Bangalore
102 Rohan Gupta Chennai
103 Ali Reza Hyderabad
104 Rishabh Jain Chennai
105 Simran Kaur Chandigarh

TABLE: TRANSACT

TRNO ANO AMOUNT TYPE DOT
T001  101 2500 Withdraw 2017-12-21
T002 103 3000 Deposit 2017-06-01
T003  102 2000 Withdraw 2017-0S-12
T004  103 1000 Deposit 2017-10-22
T005  101 12000 Deposit 2017-11-06

1) To display details of all transaction of TYPE Depos1t from Table TRANSACT.

2) To display the ANO and AMOUNT of all Depos1ts and Withdrawals done in the month of October 2017 from table TRANSACT.

3) To display the last date of the transaction (DOT) from the table TRANSACT for the Accounts having ANO as 103

4) To display all ANO, ANAME and DOT of those persons from tables ACCOUNT and TRANSACT who have done transactions less than or equal to 3000?

5) SELECT ANO, ANAME FROM ACCOUNT WHERE ADDRESS NOT IN ('CHENNAI', 'BANGALORE');

6) SELECT DISTINCT ANO FROM TRANSACT

7) SELECT ANO, COUNT(*), MIN(AMOUNT) FROM TRANSACT GROUP BY AND HAVING COUNT(*) > 1;

8) SELECT COUNT(*), SUM(AMOUNT) FROM TRANSACT WHERE DOT <= '2017-06-01'

[8] Database Management Systems and SQL
Chapter: [8] Database Management Systems and SQL
Concept: Structured Query Language Advantages of Using SQL

State any one Absorption Law of Boolean Algebra and verily it using truth table.

[9] C++ Boolean Algebra
Chapter: [9] C++ Boolean Algebra
Concept: Truth Tables (Boolean Algebra)

ARR[15] ft:20] is a two-dimensional array, which is stored in the memory along the row with each of its elements occupying 4 .bytes. Find the .address of the element ARR[5)[15], if the element ARR[lO] [5] is stored at the memory location 35000.

[7] Data Structures
Chapter: [7] Data Structures
Concept: One and Two Dimensional Arrays - Sequential Allocation and Address Calculation

Observe the following table MEMBER carefully and write the name of the RDBMS operation out of (i) SELECTION (ii) PROJECTION (iii) UNION (iv) CARTESIAN PRODUCT, which has been used to produce the output as shown in RESULT. Also, find the Degree and Cardinality of the RESULT :

MEMBER

NO MNAME STREAM
M001 JAYA SCIENCE
M002 ADITYA HUMANITIES
M003 HANSRAJ SCIENCE
M004 SHIVAK COMMERCE

RESULT

NO MNAME STREAM
M002 ADI'l'YA HUMANITIES
[8] Database Management Systems and SQL
Chapter: [8] Database Management Systems and SQL
Concept: Structured Query Language Advantages of Using SQL
< prev  1 to 20 of 97  next > 
Advertisements
Advertisements
CBSE Science (English Medium) Class 12 Question Bank Solutions
Question Bank Solutions for CBSE Science (English Medium) Class 12 Biology
Question Bank Solutions for CBSE Science (English Medium) Class 12 Chemistry
Question Bank Solutions for CBSE Science (English Medium) Class 12 Computer Science (C++)
Question Bank Solutions for CBSE Science (English Medium) Class 12 Computer Science (Python)
Question Bank Solutions for CBSE Science (English Medium) Class 12 English Core
Question Bank Solutions for CBSE Science (English Medium) Class 12 English Elective - NCERT
Question Bank Solutions for CBSE Science (English Medium) Class 12 Entrepreneurship
Question Bank Solutions for CBSE Science (English Medium) Class 12 Geography
Question Bank Solutions for CBSE Science (English Medium) Class 12 Hindi (Core)
Question Bank Solutions for CBSE Science (English Medium) Class 12 Hindi (Elective)
Question Bank Solutions for CBSE Science (English Medium) Class 12 History
Question Bank Solutions for CBSE Science (English Medium) Class 12 Informatics Practices
Question Bank Solutions for CBSE Science (English Medium) Class 12 Mathematics
Question Bank Solutions for CBSE Science (English Medium) Class 12 Physical Education
Question Bank Solutions for CBSE Science (English Medium) Class 12 Physics
Question Bank Solutions for CBSE Science (English Medium) Class 12 Political Science
Question Bank Solutions for CBSE Science (English Medium) Class 12 Psychology
Question Bank Solutions for CBSE Science (English Medium) Class 12 Sanskrit (Core)
Question Bank Solutions for CBSE Science (English Medium) Class 12 Sanskrit (Elective)
Question Bank Solutions for CBSE Science (English Medium) Class 12 Sociology
Share
Notifications



      Forgot password?
Use app×