You are on page 1of 3

OBJECT ORIENTED PROGRAMMING

Lab # 01 OOP

MUHAMMAD SAIM ASHRAF

Names

FA21-BEE-128
Registration
Numbers

Class 3A (BEE)

Instructor’s Name DR RIAZ HUSSAIN

Lab Assessment
Post Lab Total
Pre-Lab In-Lab
Data Presentation Data Analysis Writing Style
Lab 01 – Review of Basic Programming
Concepts
5.1:- In this, first I have created a structure for a book which
stores book Id, price and pages of a book. This is a user defined
program so the user will give details so to display the data of
most expensive book I have used if/else command.

Link: https://onlinegdb.com/PdtCh7pfb

5.2:- In this I have first declared integers and the ask user to
enter their values after this using pointer I have managed to
add 10 to value and display it.

Link: https://onlinegdb.com/bLqwVVzbx

5.3 A:- In this I have to swap the values of integers using


pass by value function no return type is used so I have created
a pass by value function and mixed up the integer to each
other and then in main I have called the function

Link: https://onlinegdb.com/iSamItG5f

5.3 B:- In this we have to check the difference between


pass by value and pass by reference function so we have
declared both function and called in main and we see that pass
by value does not swap integers but pass by reference does

Link: https://onlinegdb.com/d7cFldfMP
6.1:- In this I have created an employee structure that
stores some of its data like id and date of joining then I have
asked user to enter current date then by using this if
statement if(abs(E[i].yyyy-yyyy)>=3) I have managed to
display the employees which are working for more then 3
years.

Link: https://onlinegdb.com/G9l69DIzM

6.2:- In this we have created a program that sort the values


in ascending order by using selection sort and swap function

Link: https://onlinegdb.com/s_1IFR-YE

6.3:- In this we just have to make a program which takes


string and show in reverse order for this I have created a
function reversestring and using pointer I have reversed the
string

Link: https://onlinegdb.com/jDhd4dcMO

You might also like