Trending ▼   ResFinder  

CBSE Pre Board Class 12 2017 : Computer Science (Maharashtra Higher Sec. School, Jabalpur) Test 1

6 pages, 54 questions, 0 questions with responses, 0 total responses,    2    0
rajan53
Maharashtra Higher Sec. School, Jabalpur
+Fave Message
 Home > rajan53 >   F Also featured on: School Page cbse12_pre_boards

Formatting page ...

Sub.- Computer Science [C++] Class- XII MM. -70 Time- 3 Hrs. Q1. What is OOP s and their concepts? 1 Q2. What are static functions? 1 Q3. What is local and global class? 1 Q4. Write the names of the header files to which the following belong 1. Getline() 2. Strcmp() 1 Q5. What is a spam mail? 1 Q6. Which C++ header file(s) will be essentially required to be included to run /execute the following C++ code: 1 void main() { char Msg[ ]="Sunset Gardens"; for (int I=5;I<strlen(Msg);I++) puts(Msg); } Q7. What is Recursion? Give example also. 2 Q8. In the following program, if the value of N given by the user is 15, what maximum and minimum values the program could possibly display? 2 #include <iostream.h> #include <stdlib.h> void main() { int N,Guessme; randomize(); cin>>N; Guessme=random(N)+10; cout<< \n <<Guessme; } Q9. What is the output of following program? 3 1 int x=1o,y; 2. int x=10,y; 3. cout << setw(5) << 77 <<endl; y=x + x++; y=++x + x++ + x; cout << setw(5) << 100 <<endl; cout<<y; cout<<y; cout << setw(5) << 12312<<endl; Q10. What do you understand by Degree and Cardinality of a table? 2 Q11. Name the function/method required to : 2 (i) check if a string contains only uppercase letters (ii) gives the total length of the string. Q12. What do you understand by Polymorphism? Give a suitable example of the same. 2 Q13. Write a function in C++ to find sum of rows from a two dimensional array. 2 Q14. Reads the given code carefully and rewrite it after removing all syntactical errors with each correction underlined. Note: Assume all required header files are already being included in the program. 2 #Define float Max=70.0; Void main() { int Speed char Stop= N ; cin>>Speed; if Speed>Max Stop= Y ; cout<<Stop<<end; } Q15. Answer the questions (i) and (ii) after going through the following class: 2 class Seminar { int Time; public: Seminar() //Function 1 { Time=30; cout<< \n Seminar starts now ; } void Lecture() //Function 2 { cout<< \n Lectures in the seminar on ; } Seminar(int Duration) //Function 3 { Time=Duration; cout<< \nSeminar starts now ; } ~Seminar() //Function 4 { cout<< \n Vote of thanks ; } }; i) In Object Oriented Programming, what is Function 4 referred as and when does it get invoked/called? ii) In Object Oriented Programming, which concept is illustrated by Function 1 and Function 3 together? Write an example illustrating the calls for these functions. Q16. Observe the following C++ code and answer the questions : 2 class Traveller { long PNR; char TName[20]; public : Traveller() //Function 1 {cout<<"Ready"<<endl;} void Book(long P,char N[]) //Function 2 {PNR = P; strcpy(TName, N);} void Print() //Function 3 {cout<<PNR << TName <<endl;} ~Traveller() //Function 4 {cout<<"Booking cancelled!"<<endl;} }; (i) Fill in the blank statements in Line 1 and Line 2 to execute Function 2 and Function 3 respectively in the following code: void main{) { Traveller T; _____________//Line 1 _____________//Line 2 }//Stops here Q17. Write the output of the following C++ program code: 2 Note: Assume all required header files are already being included in the program. void Position (int &C1, int C2=3) { C1+=2; C2+=Y; } void main() { int P1=20, P2=4; Position(P1); cout<<P1<< , <<P2<<endl; Position(P2,P1); cout<<P1<< , <<P2<<endl; } Q18. Rewrite the following program after removing the syntactical errors (if any). Underline each correction. 2 #include [iostream.h] class MEMBER { int Mno;float Fees; PUBLIC: void Register(){cin>>Mno>>Fees;} void Display{cout<<Mno<<" : "<<Fees<<endl;} }; void main() { MEMBER M; Register(); M.Display(); } Q19. Answer the questions (i) and (ii) after going through the following class: 2 class Seminar { int Time; public: Seminar() //Function 1 { Time=30; cout<< \n Seminar starts now ; } void Lecture() //Function 2 { cout<< \n Lectures in the seminar on ; } Seminar(int Duration) //Function 3 { Time=Duration; cout<< \nSeminar starts now ; } ~Seminar() //Function 4 { cout<< \n Vote of thanks ; } }; i) In Object Oriented Programming, what is Function 4 referred as and when does it get invoked/called? ii) In Object Oriented Programming, which concept is illustrated by Function 1 and Function 3 together? Write an example illustrating the calls for these functions. Q20. Write a function to count the number of blank present in a text file named "abc.txt". 2 Q21. What is a copy constructor? Give a suitable example in C++ to illustrate with its definition within a class and a declaration of an object with the help of it . 2 Q22. What is a copy constructor? Give a suitable example in C++ to illustrate with its definition within a class and a declaration of an object with the help of it . 3 Q23. Find the output of the following code. Assume all required header files are already being included in the program. 3 class Calc { char Grade; int Bonus; public: Calc() { Grade = 'E'; Bonus = 0; } void Down(int G) { Grade -= G; } void Up(int G) { Grade += G; Bonus++; } void Show() { cout << Grade << "#" << Bonus << endl; } }; int main() { Calc C; C.Down(2); C.Show(); C.Up(7); C.Show(); C.Down(2); C.Show(); } Q24. Write a C++ program to write number 1 to 100 in a data file NOTES.TXT. 3 Q25. Define a class TEST in C++ with following description: 4 Private Members a. TestCode of type integer b. Description of type string c. NoCandidate of type integer d. CenterReqd (number of centers required) of type integer e. A member function CALCNTR() to calculate and return the number of centers as (NoCandidates/100+1) Public Members A function SCHEDULE() to allow user to enter values for TestCode, Description, NoCandidate & call function CALCNTR() to calculate the number of Centres A function DISPTEST() to allow user to view the content of all the data Members. Q26. Answer the questions (i) to (iv) based on the following: 4 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(); }; (i) Write the names of data members, which are accessible from objects belonging to class AUTHOR. (ii) Write the names of all the member functions which are accessible from objects belonging to class BRANCH. (iii) Write the names of all the members which are accessible from member functions of class AUTHOR. (iv) How many bytes will be required by an object belonging to class AUTHOR? Q27. Knowledge Supplement Organization has set up its new center at Mangalore for its office and web based activities. It has 4 blocks of buildings as shown in the diagram below: 4 Center to center distances between various blocks: Block A to Block B Block B to Block C Block C to Block D Block A to Block D Block B to Block D Block A to Block C Number of Computers: Block A Block B Block C Block D 50m 150m 25m 170m 125m 90m 25 50 125 10 1) Suggest a cable layout of connections between the blocks. 2) Suggest the most suitable place (i.e. block) to house the server of this organization with a suitable reason. 3) Suggest the placement of the following devices with justification. (i) Repeater (ii) Hub/Switch 4) The organization is planning to link its front office situated in the city in a hilly region where cable connection is not feasible, suggest an economic way to connect it with reasonably high speed? Q28. Answer the question (i) to (iv) based on the following: 4 class Exterior { int OrderId; char Address[20]; protected: float Advance; public: Exterior(); void Book(); void View(); }; class Paint:public Exterior { int WallArea,ColorCode; protected: char Type; public: Paint() ; void PBook(); void PView(); }; class Bill:public Paint { float Charges; void Calculate(); public: Bill() ; void Billing() ; void Print() ; }; (i) Which type of Inheritance out of the following is illustrated in the above example? (ii) Write the names of all the data members, which are directly accessible from the member functions of class Paint. (iii) Write the names of all the member functions, which are directly accessible from an object of class Bill. (iv) What will be the order of execution of the constructors, when an object of class Bill is declared? Q29. Given the following student table : NO Name Age Department DateOfAdm Fee 1 Pankaj 24 Computer 10/01/97 120 2 Shalini 21 History 24/03/98 200 3 Sanjay 22 Hindi 12/12/96 300 4 Sudha 25 History 01/07/99 400 5 Rajan 22 Computer 05/09/97 250 6 Shakeel 30 History 21/06/98 300 7 Surya 34 Hindi 25/02/97 210 8 Shikha 23 Computer 31/07/97 200 Write SQL commands for (1) to (6) and write output for (7). 6 1. To show all information about the students of history department. 2. To list the names of female students who are in hindi department. 3. To list name of all students with their date of admission in ascending order. 4. To display student s Name, Fee, Age for male students only. 5. To count the number of students with age<23. 6. To insert a new row in the Student table with the following data 9, Khushbu ,32, Computer ,{17/07/97},230, F 7. Give the output of following SQL statements : 2 A] Select Count(distinct department) from Student; B] Select Max(age) from Student where Gender= F ; C] Select Sum(Fee) from Student where DateOfAdm<{01/01/98}; D] Select Avg(Fee) from Student where DateOfAdm<{01/01/98}; Gender M F M F M M M F

Formatting page ...

Formatting page ...

Formatting page ...

Formatting page ...

Formatting page ...

 

  Print intermediate debugging step

Show debugging info


 

 

© 2010 - 2025 ResPaper. Terms of ServiceContact Us Advertise with us

 

rajan53 chat