Computer Programming CP - Bahria
Computer Programming CP - Bahria
Semester : Fall-2022
Lab Engineer : Fatima Bashir
TASKS
Write a program that takes 3 values from user. Two values of integer and one
value of float data type. Print each result on one line.
Task 3 : Percentage
Write a C++ program that prompt input roll number, student name and marks of
three subjects
1. Computer Programming = CP
2. Introduction to communication Technologies = ICT
3. Data Science = DS
Calculate total marks, percentage of student.
Marks percentage = marks obtained / total * 100
Write a program to solve the following equation. Take value of a and b from user.
X = (a + b)2
Write a program that plays a word game with the user. The program should ask
the user to enter the following also display user age in days from current date.
User’s name
Year of birth (eg. 1990)
Name of university
A favorite hobby
A pet’s name
Task 6
Hypotenuse refers to the right angle in a triangle (as shown in the side opposite right-
angled the diagram below).
Area of this right-angled triangle can also be calculated using the following formula: a
=½*x*y
Note that:
h=Hypotenuse
x= adjacent
y= opposite
Write a C++ program that prompt user to enter value of X and Y. You have to calculate
the value of Hypotenuse (h) and Area(a).