IT-107-Mid Term Paper-Spring 2021
IT-107-Mid Term Paper-Spring 2021
Create a class called Employee that includes three pieces of information as instance variables – a first
name (type String), a last name (type String) and a monthly salary (double).create a constructor in
above class to initialize the three instance variables.
Q.1) Create two employee objects and display each object’s yearly salary. [3]
Q.2) Give each employee a 10% raise and display each Employee’s yearly salary again. (Create and
Use Member function) [3]
----------------------------------------------------------------------------------------------------------------------------------
Write a class Array that contains an array of integers as data member. The class contains the following
member functions:
Q.8) Using an object oriented programming language with which you are familiar write a class which contains
a method called getNumberOfInstances. This method should return the number of instances of the class [3]
Q.9) What will be the output of program?? [2]
1. #include <iostream>
2. using namespace std;
3. int main()
4. {
5. int const p = 5;
6. cout << ++p;
7. return 0;
8. }
Q10) What is the output of this program? [2]
1. #include <iostream>
2. using namespace std;
3. int g = 100;
4. int main()
5. {
6. int a;
7. {
8. int b;
9. b = 20;
10. a = 35;
11. g = 65;
12. cout << b << a << g;
13. }
14. a = 50;
15. cout << a << g;
16. return 0;
17. }