0% found this document useful (0 votes)
23 views

Assignment 3

Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
23 views

Assignment 3

Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

K. K. Wagh Polytechnic, Nashik.

Hirabai Haridas Vidyanagari, Amrutdham,


Panchavati, Nashik-422003
Department of Computer Technology
Semester
:- III Master: ‘I’
Subject
:- Object Oriented Programming (OOP) Subject Code: - 22316

Assignment No . 3
Chapter No -02 Classes and Object

Marks-18
1. Explain memory allocation for object with example.
2. Describe access specifier with example. Difference between public and private access specifier.
3. Explain with example object as member function argument.
4. Explain syntax for declaring the function inside the class and outside the class with example.
5. Write characteristics of static member function. Give one example.
6. Write characteristics of static member variable. How it is declared. Give one example.
7. Write characteristics of friend function.
8. Explain use of friend function. Give one example.
9. Write a program to declare class mobile having data members as price and model number.
Accept and display this data for one object.
10. Create a class “Account” with data member as acct.no. and balance. Create member function as
getdata () and showdata (). Accept and display() data for 10 object.
11. Define a class named ‘Train’ representing following members:
Data members :Train Number, Train Name, Source, Destination, Journey Date, Capacity.
Menber functions: Initialise, Input data, Display data.
Write a C++ program to test the train class.
12. Write a program to find greatest number among two numbers from two different classes from
friend function.
13. Write a program to calculate sum of distance and display the result using friend function.
14. Write a program to display number of objects created using static function.
15. Write a program to calculate weight of object on planet use W=M*G. Where g is static variable.
16. Write a program to declare a class employee having data members name and basic salary.
Accept this data for 5 employees and display gross salary using formula.
Gross salary= Basic + DA+ HRA [Where DA= 44.5% of Basic, HRA= 15% of Basic]
17. Write a program to declare class Account having data member as acc_no and balance. Accept
data for five objects and display only the highest balance account details.
18. Define a class named ‘Bank Account’ to represent following members:
Data members :-
- Account Number, - Name of Depositor, - Account Type, - Balance Amount
Member functions:
- Initialize members, - Deposit Amount, - Withdraw Amount, - Display Balance
Write a C++ program to test the Bank Account class for 10 customers
19. Define properties of constructor function and list types of constructor. Write syntax of declare
constructor.
20. How do we invoke a constructor?
21. What is destructor? Give it’s syntax.
22. How many destructor can be defined in a single class?
23. Difference between constructor and destructor.
24. When ambiguity occurs in constructor and how to solve it.
25. Explain the concept of default constructor with example.
26. Explain the concept of parameterized constructor with example.
27. Explain the concept of copy constructor with example.
28. Explain the concept of overloaded constructor with example.
29. Define a class college which will contain member variable as roll_no, name, course. Write a
program using constructor with default values as “information technology” for course. Accept
this data for two objects of class and display the data.
30. Write a program to define a class Product having data members Prod_id, Prod_name,
Prod_price. Accept and display data for 3 products using constructor overloading.

Mr. G. R. Shinde
(Subject Teacher)

You might also like