Sie sind auf Seite 1von 14

Amity Campus Uttar Pradesh India 201303

ASSIGNMENTS
PROGRAM: BSc IT SEMESTER-IV
Subject Name Study COUNTRY Roll Number (Reg.No.) Student Name : : : :

INSTRUCTIONS a) Students are required to submit all three assignment sets. ASSIGNMENT Assignment A Assignment B Assignment C b) c) d) e) DETAILS Five Subjective Questions Three Subjective Questions + Case Study Objective or one line Questions MARKS 10 10 10

Total weightage given to these assignments is 30%. OR 30 Marks All assignments are to be completed as typed in word/pdf. All questions are required to be attempted. All the three assignments are to be completed by due dates and need to be submitted for evaluation by Amity University. f) The students have to attached a scan signature in the form.

Signature : Date :

_________________________________ _________________________________

( ) Tick mark in front of the assignments submitted Assignment Assignment B Assignment C A

Introduction to Object Oriented Programming & C++


Part A
Q1. Explain briefly characteristics of OOPS language and mention advantages of approach Q2. Q3. Q4. Q5. over procedural programming OOPS language.

Give the tabular difference between structures, and classes. What is the difference between keyword and identifier? What is difference between fundamental and derived data types? Differentiate between call by reference and call by value

Part B
Q1.Write a C++ program that invoke a function calc() which intake two integer and an arithmetic Q2.Answer operator the questions and (i) to print (iii) the based on corresponding the following result.. code

class stationary { char Type; char Manufacturer [10]; public: stationary(); void Read_sta_details( ); void Disp_sta_details( ); }; class office: public stationary { int no_of_types; float cost_of_sta; public: void Read_off_details( ); void Disp_off_details( ); }; class printer: private office { int no_of_users; char delivery_date[10]; public: void Read_pri_details( ); void Disp_pri_details( ); }; void main ( ) { printer MyPrinter; } i. ii. Mention the member names which are accessible by MyPrinter declared in main() function What is the size of MyPrinter in bytes?

iii.

Mention the names of functions accessible from the member function Read_pri_details () of class printer.

Q3.

Develop a Project on any one using C++ : a. b. c. Hospital Management System Railways Reservation System Student Information System

Part C
Q1 Which of the following is false?

a. Cout represents the standard output stream in c++. b. Cout is declared in the iostream standard file c. Cout is declared within the std namespace d. None of above

Q2.

What is the only function all C++ programs must contain?

A. start() B. system() C. main() D. program()

Q3. A. { }

What punctuation is used to signal the beginning and end of code blocks?

B. -> and <C. BEGIN and END D. ( and )

Q4.

What punctuation ends most lines of C++ code?

A. . (dot) B. ; (semi-colon) C. : (colon) D. ' (single quote)

Q5.

Which of the following is a correct comment?

A. */ Comments */ B. ** Comment ** C. /* Comment */ D. { Comment } Q6. B. real C. int D. double Q7. A. := B. = C. equal D. == Q8. A. 1 B. 66 C. .1 D. -1 E. All of the above Which of the following is true? Which of the following is the correct operator to compare two variables? Which of the following is not a correct variable type?

A. float

Q9. A. & B. && C. | D. |&

Which of the following is the boolean operator for logical-and?

Q10.

Evaluate !(1 && !(0 || 1)).

A. True B. False C. Unevaluatable

Q11.

Every statement in C++ program should end with

a. A full stop (.) b. A Comma (,) c. A Semicolon (;) d. A colon (:)

Q12. C++ was originally developed by 1. Nicolas Wirth 2. Donald Knuth 3. Bjarne Stroustrup 4. Ken Thompson

Q13. The standard c++ comment 1. / 2. // 3. /* and */ 4. None of these

Q14. The preprocessor directive #include is required if

1. Console output is used 2. Console input is used 3. Both console input and output is used 4. None of these

Q15. The operator << is called 1. an insertion operator 2. put to operator 3. either a or b 4. None of these

Q16. The operator >> is called 1. an extraction operator 2. a get from operator 3. either a or b 4. get to operator

Q17. When a language has the capability to produce new data type, it is called 1. Extensible 2. Overloaded 3. Encapsulated 4. Reprehensible

Q18. The C++ symbol << 1. perform the action of sending the value of expression listed as its right to the outputs strewn as the left. 2. is used to indicate the action from right to left 3. is adopted to resemble an arrow 4. All the above

Q19. What is a reference? 1. an operator 2. a reference is an alias for an object 3. used to rename an object 4. None of these

Q20. A constructor is called whenever 1. a object is declared 2. an object is used 3. a class is declared 4. a class is used Q21. State the object oriented languages 1. C++ 2. Java 3. Eiffel 4. All of the above

Q22. Overload function in C++ 1. a group function with the same name 2. all have the same number and type of arguments 3. functions with same name and same number and type of arguments 4. All of the above

Q23. Operator overloading is 1. making c++ operators works with objects 2. giving new meaning to existing c++ operators 3. making new c++ operator 4. both a& b above

Q24. A constructor is called whenever 1. a object is declared 2. an object is used 3. a class is declared 4. a class is used

Q25. A class having no name 1. is not allowed 2. can't have a constructor 3. can't have a destructor 4. can't be passed as an argument

Q26. The differences between constructors and destructor are 1. constructors can take arguments but destructor can't 2. constructors can be overloaded but destructors can't be overloaded 3. both a & b 4. None of these Q27. A destructor takes 1. one argument 2. two arguments 3. three arguments 4. Zero arguments

Q28. Constructors are used to 1. initialize the objects 2. construct the data members

3. both a & b 4. None of these

Q29. In C++ a function contained with in a class is called 1. a member function 2. an operator 3. a class function 4. a method Q30. The fields in a class of a c++ program are by default 1. protected 2. public 3. private 4. None Q31. A variable is/are a. String that varies during program execution b. A portion of memory to store a determined value c. Those numbers that are frequently required in programs d. None of these

Q32. Which of the following can not be used as identifiers? a. Letters b. Digits c. Underscores d. Spaces

Q33.

The difference between x and x is a. The first one refers to a variable whose identifier is x and the second one refers to the character constant x b. The first one is a character constant x and second one is the string literal x c. Both are same d. None of above

Q34.

Which of the following statement is true? a. String Literals can extend to more than a single line of code by putting a backslash sign at the end of each unfinished line. b. You can also concatenate several string constants separating them by one or blank spaces, tabulators, newline or any other valid blank character c. If we want the string literal to explicitly made of wide characters, we can precede the constant with the L prefix d. All of above several

Q35.

Regarding following statement which of the statements is true? const int pathwidth=100; a. Declares a variable pathwidth with 100 as its initial value b. Declares a construction pathwidth with 100 as its initial value

c. Declares a constant pathwidth whose value will be 100 d. Constructs an integer type variable with pathwidth as identifier and 100 as value

Q36. a. b. c. d. Q37. a. b. c. d.

If you use same variable for two getline statements Both the inputs are stored in that variable The second input overwrites the first one The second input attempt fails since the variable already got its value You can not use same variable for two getline statements The return 0; statement in main function indicates The program did nothing; completed 0 tasks The program worked as expected without any errors during its execution not to end the program yet. None of above

Q38. a. b. c. d.

The size of following variable is not 4 bytes in 32 bit systems int long int short int float

Q39.

Identify the correct statement regarding scope of variables

a. b. c. d.

Global variables are declared in a separate file and accessible from any program. Local variables are declared inside a function and accessible within the function only. Global variables are declared inside a function and accessible from anywhere in program. Local variables are declared in the main body of the program and accessible only from

functions. Q40 a. b. cin extraction stops execution as soon as it finds any blank space character true false

Das könnte Ihnen auch gefallen