list of question in c++.pdf

2
List of Question in C++ 1. Write a C++ program to answer about the statistical information such as arithmetic mean, median, mode, and standard deviation of an integer data set. The data points are input by the user from keyboard. 2. Explain the concept and importance of inheritance and explain complication of multiple inheritances in C++ with solution. 3. What is the difference between method overloading (also explain different ways to overload method overloading) and overriding with example, how do we call overridden method. 4. What is the difference between public, private and protected inheritance derivation explain with example. 5. A class called circle is designed as shown in the following class diagram. It contains: Two private instance variables: radius (of type double) and color (of type String), with default value of 1.0 and "red", respectively. Two overloaded constructors; Two public methods: getRadius() and getArea(). 6. What do you mean by static and early binding explain. 7. Can we access private data member of a class, explain the different ways of accessing the private data with example. 8. Suppose that we are required to model students and teachers in our application. We can define a superclass called Person to store common properties such as name and address, and subclasses Student and Teacher for their specific properties. For students, we need to maintain the courses taken and their respective grades; add a course with grade, print all courses taken and the average grade. A student takes no more than 30 courses for the entire program. For teachers, we need to maintain the courses taught currently, and able to add or remove a course taught. A teacher teaches not more than 5 courses concurrently. Write a C++ program. 9. What is the difference between has-a and Is-a Relationship. 10. Write a c++ program using classes and object concept that Given an array of int’s, return true if 6 appears as either the first or last element in the array. The array will be length 1 or more. firstLast6({1, 2, 6}) → true

Upload: ujjwal-mahajan

Post on 10-Dec-2015

220 views

Category:

Documents


2 download

TRANSCRIPT

Page 1: List of Question in C++.pdf

List of Question in C++

1. Write a C++ program to answer about the statistical information such as arithmetic mean,

median, mode, and standard deviation of an integer data set. The data points are input by the

user from keyboard.

2. Explain the concept and importance of inheritance and explain complication of multiple

inheritances in C++ with solution.

3. What is the difference between method overloading (also explain different ways to overload

method overloading) and overriding with example, how do we call overridden method.

4. What is the difference between public, private and protected inheritance derivation explain

with example.

5.

A class called circle is designed as shown in the following class diagram. It contains:

Two private instance variables: radius (of type double) and color (of type String), with default value

of 1.0 and "red", respectively.

Two overloaded constructors;

Two public methods: getRadius() and getArea().

6. What do you mean by static and early binding explain.

7. Can we access private data member of a class, explain the different ways of accessing the

private data with example.

8. Suppose that we are required to model students and teachers in our application. We can define

a superclass called Person to store common properties such as name and address, and

subclasses Student and Teacher for their specific properties. For students, we need to maintain

the courses taken and their respective grades; add a course with grade, print all courses taken

and the average grade. A student takes no more than 30 courses for the entire program. For

teachers, we need to maintain the courses taught currently, and able to add or remove a course

taught. A teacher teaches not more than 5 courses concurrently. Write a C++ program. 9. What is the difference between has-a and Is-a Relationship.

10. Write a c++ program using classes and object concept that Given an array of int’s, return true if

6 appears as either the first or last element in the array. The array will be length 1 or more.

firstLast6({1, 2, 6}) → true

Page 2: List of Question in C++.pdf

firstLast6({6, 1, 2, 3}) → true

firstLast6({13, 6, 1, 2, 3}) → false

11. Develop a polymorphic banking program to withdraw; deposits, and display information

after each transaction, also give proper condition on low balance. User needs to select

current or saving account and then do the operations.