0% found this document useful (0 votes)
15 views1 page

18-02-2025-Lab Task 1

The document outlines lab tasks for the Object Oriented Programming course at the University of Lahore, instructed by Miss Iqra Adnan. It includes two parts: Part A focuses on creating functions for basic arithmetic operations and factorial calculations, while Part B involves user input for geometric shapes, comparisons, discounts, grading systems, age determination, and character classification. Students are expected to implement these tasks using programming concepts learned in the course.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
15 views1 page

18-02-2025-Lab Task 1

The document outlines lab tasks for the Object Oriented Programming course at the University of Lahore, instructed by Miss Iqra Adnan. It includes two parts: Part A focuses on creating functions for basic arithmetic operations and factorial calculations, while Part B involves user input for geometric shapes, comparisons, discounts, grading systems, age determination, and character classification. Students are expected to implement these tasks using programming concepts learned in the course.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 1

The University of Lahore

Department of CS & IT
Object Oriented Programming Lab Tasks
Instructor Name: Miss Iqra Adnan Course Code: CS02203 | 11
Course Title: Object Oriented Programming
Student Name: University ID:
PART A
1. Write a program to add two integers. Make a function add() to add integers and display
sum in main function.
2. Write a program that takes input a number in main function and passes the number to a
function. The function will display the factorial of that number.
3. Write a function ‘sum’ to add the values for three variables and store the result in
another variable. Function will take 3 arguments as default. Call the function in main
with 1,2, and 3 variables.
PART B
1. Take values of length and breadth of a rectangle from user and check if it is square or not.
2. Take two int values from user and print greatest among them.
3. A shop will give discount of 10% if the cost of purchased quantity is more than 1000.
Ask user for quantity. Suppose, one unit will cost 100. Judge and print total cost for user.
4. A university has following rules for grading system
a. 85 to 100 – A+
b. 80 to 84 – A
c. 75 to 79 – B+
d. 70 to 74 – B
e. 65 to 69 – C+
f. 60 to 64 – C
g. 55 to 59 – D+
h. 50 to 54 – D
i. Below 50 – F
Ask user to enter marks and print the corresponding grade
5. Take input of age of 3 people by user and determine oldest and youngest among them
6. Write a program to take the value from the user as input. Value can be any alphabet.
Check whether it is vowel or consonant. Using the switch statement
7. Write a program to take the value from the user as an input week number and print
weekday by using the switch statement.

You might also like