0% found this document useful (0 votes)
9 views5 pages

Lab Journal 04 CP 01032024 095149am

The document is a lab journal for a Computer Programming course at Bahria University, outlining objectives and tasks for students. It includes programming assignments that involve basic arithmetic operations, temperature conversion, weight conversion, and area calculation of a right-angled triangle. The lab grading sheet indicates a total of 10 marks available for the tasks.

Uploaded by

ibrahimkhann1610
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)
9 views5 pages

Lab Journal 04 CP 01032024 095149am

The document is a lab journal for a Computer Programming course at Bahria University, outlining objectives and tasks for students. It includes programming assignments that involve basic arithmetic operations, temperature conversion, weight conversion, and area calculation of a right-angled triangle. The lab grading sheet indicates a total of 10 marks available for the tasks.

Uploaded by

ibrahimkhann1610
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/ 5

Bahria University, Lahore Campus

Department of Computer Science


Lab Journal 04

Course : Computer Programming - Lab Date: 13th March 2024


Course Code: CSL-113 Max Marks: 10
Faculty’s Name:

Name: Muhammad Ibrahim Enroll No: 03-135241-058 Class: BS(IT)-1

Objective(s):
Upon completion of this lab session, students will be able to:
• Understand the Data types and variables
• Understand the of Operators and

Tasks
Task 01:
1. Write a program that gets 2 integers input from the user and stores them in variables. Do
the five basic Arithmetic Operations (+, - , *, /, %) of the two numbers. Print the results of
operations as below.
%

Enrollment Number: 03-135241-058

2. Write a program that prompt user to input the course name, obtained marks, and total
marks. Calculate the percentage using the below formula
marks_percentage = ( marks_obtained / total )* 100
and display the results as follows.

Task 02:
1. Write a program that converts Celsius temperatures to Fahrenheit temperatures. The
formula is:
F= (9/5)*C+32

Page 2 of 5
%

Enrollment Number: 03-135241-058

F is the Fahrenheit temperature and C is the Celsius temperature.

2. Write a program that prompts the user to enter the weight of a person in kilograms and
outputs the equivalent weight in pounds. Output both the weights rounded to two decimal
places. (Note that 1 kilogram is equal to 2.2pounds.) Format your output with two decimal
places.

Page 3 of 5
%

Enrollment Number: 03-135241-058

Task 03:

Hypotenuse refers to the side opposite the right angle in a right-angled triangle (as shown in
the diagram below).

The 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 prompts the user to enter the value of X and Y. You have to
calculate the value of Area (a)

Page 4 of 5
%

Enrollment Number: 03-135241-058

Lab Grading Sheet:

Max Obtained
Task Comments (if any)
Marks Marks
1. 4

2. 4

3. 2

Total 10 Signature

Note: Attempt all tasks and get them checked by your Lab Instructor.

Page 5 of 5

You might also like