Oral Questions

advertisement
Department of computer science and information
Computer Programming II
Level: 3G (940) Course: 104 CS
1435-1436H Jan.14 –June 2015
Oral Questions
Max.Marks [ 2M ]
Student Name:
Duration: 15 Min.
Date:
Academic No.:
Student Name:
Marks Obtained:
Department of computer science and information
Computer Programming II
Level: 3G (940) Course: 104 CS
1435-1436H Jan.14 –June 2015
Oral Questions
Max.Marks [ 2M ]
Student Name:
Duration: 15 Min.
Date:
Academic No.:
Student Name:
Marks Obtained:
Department of computer science and information
Computer Programming II
Level: 3G (940) Course: 104 CS
1435-1436H Jan.14 –June 2015
Oral Questions
Max.Marks [ 2M ]
Student Name:
Duration: 15 Min.
Date:
Academic No.:
Student Name:
Marks Obtained:
Department of computer science and information
Computer Programming II
Level: 3G (940) Course: 104 CS
1435-1436H Jan.14 –June 2015
Oral Questions
Max.Marks [ 2M ]
Student Name:
Duration: 15 Min.
Date:
Academic No.:
Student Name:
Marks Obtained:
Oral Questions:
1. Expand O.O.P.s?
Answer: Object Oriented Programming Language.
2. Expand P.O.P’s?
Answer: Procedure Oriented Programming Language.
3. What is the difference between structure and class?
Answer: Structure contains only variable where as class contains both variables and functions
4. Tell some features of C++?
Answer: Data encapsulation, classes, inheritance, polymorphisms, Constructors & Destructors,
message passing, data hiding and so on.
5. Define class?
Answer: Class is a collection of similar objects.
6. Define Object?
Answer: Object is a part of class which implements the class.
7. What is data encapsulation?
Answer: Both data and functions wrapped to gather in a single unit.
8. Define functions?
Answer: Functions are the sub programs to implement some sub task.
9. Define variable, identifiers, comments?
Answer: Variables are the locations to store some values. Identifiers are the names given the
variables. Comments are used to ignore and for understanding by the user only. Comments are
written in by suing /*..*/ or //.
10. List few loops available in C++?
Answer: If-Else, case, do-while, while, for.
11. Tell some names of data types?
Answer: Integer, float, string, character secondary data types like arrays, stacks, queues, linked lists,
trees graphs.
12. What is the range of int data type?
Answer: -32768 - 32767
13. Why C++ is good compared to C?
Answer: C++ provides more security to its program, software reuse techniques available.
14. Who is the inventor of C++?
Answer: B Jarne Strousstrap.
15. Is C is the extension of C++ language?
Answer: Yes C++ is the extension of C Langauge.
16. Which software we are using for C++?
Answer: Dev C++
17. What are steps to be followed in C++ program execution?
Answer: Writing Program, Saving, Compiling, Correcting errors, viewing output.
18. Define compilation?
Answer: Compilation is used to generate the EXE file of the source program.
19. What are the types of errors occurred during execution of program?
Answer: Syntax errors, logical errors, runtime errors.
20. Define constructor?
Answer: Constructor is used to initialize the values of class data members. Constructors use same
name like class. Constructor is same like functions but except no return type.
21. What are the types of constructors we have?
Answer: Copy constructors, default constructors.
22. What does the class contains?
Answer: Class contains class name, variables, and member functions.
23. Why we need the objects?
Answer: Objects used to refer and implement the classes.
24. What is inheritance?
Answer: Inheritance is the concept of extending the classes and inheriting the data members and
functions in to derived class.
25. Tell some names of forms of inheritance?
Answer: Forms of inheritance like simple inheritance, multiple, multi level, hybrid, hierarchical
inheritances.
26. Define polymorphism?
Answer: Poly means much morphism means many uses. Using single thing for many uses like
operators or functions.
27. What are the types of polymorphism?
Answer: Static polymorphism, Dynamic Polymorphism.
28. Create the classes and explain the concept of multiple inheritances?
Answer: Two base classes will be created and derived class will be inherited from that.
29. What is simple inheritance?
Answer: Derive class will be inherited from the single base class.
30. What is the concept of multi level inheritance?
Answer: Class C is inherited from Class B which is inherited from Class A.
31. List few access specifiers available in C++?
Answer: Public private, protected.
32. Is it possible to inherit the base class if its variable and functions declared as private?
Answer: No
33. What is copy constructor?
Answer: Constructor contents will be copied to another constructor.
34. What is meant by function overloading?
Answer: Same function name is used for different function but parameters are different.
35. Define operator overloading?
Answer: Same operator will be used for different purposes.
36. Tell one name of operator overloading?
Answer: Unary and binary operator overloading.
37. Define templates?
Answer: Other name is parameterization which is irrespective of type of parameters. Two types of
templates function templates and class templates.
38. What are the types of templates?
Answer: Function templates and class templates.
39. Define string?
Answer: String is a collection of characters.
40. Tell some input and output operators?
Answer: << (Extraction) and >> (Insertion Operators).
41. Tell some input and output functions?
Answer: cout cin
42. Define data structure?
Answer: A collection of functions to solve a complex problem.
43. What are the types of data structures?
Answer: Data structures are of different types like array, stacks, queues, linked list, trees, and
graphs.
44. Define linked list?
Answer: Linked list is a collection of nodes which consists of 2 parts called link and data.
45. What are the types of linked lists?
Answer: Single linked list, double linked list, circular linked list, header linked list.
46. What is the purpose of sorting?
Answer: To arrange the numbers in ascending order or descending order.
47. Tell some names of sorting techniques?
Answer: Quick, merge, heap, external sorting.
48. Define graph?
Answer: Graph is collection of vertices and edges which form like a graph G= (V, E).
49. Define tree?
Answer: Trees is collection of nodes like root node, left node, right node.
50. Differentiate between graph and tree?
Answer: Tree does not form the cycle and graph forms a cycle.
51. Write the syntaxes of class and object in C++?
Answer: class class-name
{
public:
int main()
{
//Data members
class-name s1;
// Member fucntions
}
};
52. Write the syntax for constructors and parameterized constructors?
Answer: class-name (int a , int b )
{ // Data members initialization
}
Parameterized constructors:
class-name (int x, int y)
{ // Data members initialization
}
53. Write the functions for function templates and class templates?
Download