This document contains an assignment for an Object Oriented Programming class. It lists 31 programs to be completed. The programs cover topics like displaying text, numbers, and symbols; taking input and displaying output; using arrays; sorting algorithms; classes with data members and member functions; and constructors and destructors. The assignment is submitted by Zohaib Arif, a student with roll number 6823 in the evening department of Information & Technology.
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
programming
1. Page 1
Govt. Post Graduate College
Samanabad
Assignment # 01
Object Oriented Programming
Submitted To: Mam Iqra
Submitted By: Zohaib Arif
Roll no.: 6823
Semester: ῙῙ
Department of Information & Technology
(evening)
2. Page 2
Contents .
Program…………………………………………………………………………………………..Page no.
I. Display of “Word” for fivetimes……………………………………………………………............ 3
II. Display of five numbers and their sum……………………………………….……………………. 3
III. Display of counting…………………………………………………………………………….………….... 4
IV. Display of numbers and their squares…………………………………………………………...… 4
V. Inputting of number and display its table………………………………………..………….…… 5
VI. Distinguishing of even or odd numbers…………………………………………….………….….. 5
VII. Display of digits in block pattern…………………………………….………………………….….... 6
VIII. Display of symbolas a block..………………………………………………………………………….. 6
IX. Display of digits in descending order as triangle………………………………………………. 7
X. Display of digits in ascending order as triangle………………….…………………………….. 7
XI. Display of moredigits by changing firstdigit every time………………………………….. 8
XII. Initializing and display of digits fromarray…………………………………………………....... 8
XIII. Taking of number fromarray and displaying………………………………………………….... 9
XIV. Inputting storing in an array and displaying of numbers……………………………..…… 9
XV. Inputting the numbers and then store them in an array and display the sumand
averageof these numbers…………………..……………………………………………………..….. 10
XVI. Inputday and month and then calculates total number of days………………....…. 10
XVII. Inputvalue and find value using linear search……………………………………………….. 11
XVIII. Inputvalue and find value using binary search………………………………………………. 11
XIX. Inputfive values and sorts it using bubble sort…………………………………………….… 12
XX. Inputfive values and sorts it using selection sort…………………………………………... 12
XXI. Displays a massageusing function…………………………………………………….…………… 13
XXII. Inputnumbers in main function, passes thesenumbers to function and displays
maximum number………………………………………………………………………………….……… 14
XXIII. Inputa number in main function and passes and passes the number and function
display table……………………………………………………………………………………………….... 15
XXIV. Inputs a number and displays its processor and successor numbers using
function………………………………………………….……………………………………………………. 15
XXV. Create class with one integer data member and two member function……… 16
XXVI. Create class with three data member and three member function……………. 16
XXVII. Create two objects of class and input value for these objects and it displays detail of
costly book………………………………………………………………………………………………….. 17
3. Page 3
XXVIII. Create class has num& ch data members and one constructor with on parameter and
other with two parameter…………………………………………………………………………… 18
XXIX. Create class that has constructer and destructor………………………………………… 19
XXX. Create member function outside the class……………………………………………………20
XXXI. Create member function within the class…………………………………………………… 21
4. Page 4
Program # 01 : To Displayof “Word” for five times
Program # 02: To Displayof five numbers and their sum
5. Page 5
Program # 03: To Displayof counting
Program # 04: To Displayof numbers and their squares
6. Page 6
Program # 05: To Input a number and displayits table
Program # 06: To Distinguish of even or odd numbers
7. Page 7
Program # 07: To Displayof digitsin block pattern
Program # 08: To Displayof symbol as a block
8. Page 8
Program # 09: To Displaythe digits in descending order as triangle
Program # 10: To Displaythe digits in ascending order as triangle
9. Page 9
Program # 11: To Displaymore digits and changing of first digit every
time
Program # 12: To Initializingand display of digits from array
10. Page 10
Program # 13: To Take a number from an array and display
Program # 14: To Input a number and store it in an array and display
by using loop
11. Page 11
Program # 15: To Input the numbers and then store them in an array
and display the sum and average of these numbers
Program # 16: To Input day and month and then calculates total
number of days
12. Page 12
Program # 17: To Input value and find value using linear search
Program # 18: Input value and find value using binary search
13. Page 13
Program # 19:To input five values and sorts it using bubble sort
14. Page 14
Program # 20: To input five values and sorts it using selection sort
15. Page 15
Program # 21: To displays a massage using function
Program # 22: To input numbers in main function, passes these
numbers to function and displays maximumnumber
16. Page 16
Program # 23: To input a number in main function and passes and
passes the number and function display table
Program # 24: To inputs number and displays its processorand
successor number using function
17. Page 17
Program # 25:To declares a class with one integer data member and
two member function
18. Page 18
Program # 26:To make a class with three data member and three
member function
19. Page 19
Program # 27: To create two objects of class and input value for
these objects and it displays detail of costly book
20. Page 20
Program # 28:To make class has num & ch data members and one
constructor with on parameter and other with two parameter
21. Page 21
Program # 29:To create class that has constructer and destructor