0% found this document useful (0 votes)
25 views2 pages

Lab-4 Journal-04-21032023-112323am

The document outlines a lab journal for a Computer Programming course at Bahria University, detailing objectives and tasks for students to complete. Tasks include writing C++ programs for various applications such as comparing numbers, displaying months, performing arithmetic operations, calculating BMI, assigning grades based on marks, and finding factorials. The lab grading sheet is also included for evaluation purposes.

Uploaded by

sehrish.riaz
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)
25 views2 pages

Lab-4 Journal-04-21032023-112323am

The document outlines a lab journal for a Computer Programming course at Bahria University, detailing objectives and tasks for students to complete. Tasks include writing C++ programs for various applications such as comparing numbers, displaying months, performing arithmetic operations, calculating BMI, assigning grades based on marks, and finding factorials. The lab grading sheet is also included for evaluation purposes.

Uploaded by

sehrish.riaz
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/ 2

Bahria University, Lahore Campus

Department of Computer Science


Lab Journal 04

Course : Computer Programming - Lab Date: _______________


Course Code: CSL-113 Max Marks: 30
Faculty’s Name: Muhammad Sauood

Name: _____________________ Enroll No: ___________________ Class: _____________

Objective(s):
Upon completion of this lab session, students will be able to:
• Understanding of IF-ELSE, IF-ELSE-IF, For loop
Tasks
Task 1
Write a program that asks the user to enter two numbers. The program should use the
conditional operator to determine which number is the smaller and which is the larger.

Task 2
Write a C++ Program that read an integer input in between (1 to 12) and store it
month_of_year. Print the corresponding month of year. Use if else statement.
Example: Input is 4… Print “April”

Task 3
Write a C++ Menu driven program that allows a user to enter 2 numbers and then choose
between findings the sum, subtraction, division, multiplication or average. Use if else
statement to determine what action to take.
Task 4
(Body Mass Index Calculator)
The formulas for calculating, BMI is,
BMI = weight In Pounds x 703 / (height Inches x height Inches )
Create a BMI calculator application that reads the user's weight in pounds and height in
inches (or, if you prefer, the user's weight in kilograms and height in meters), then
calculates and displays the user's body mass index. The user can evaluate his/her BMI:

BMI Values
Underweight Less 18.5
Normal Between 18.5 and 24.9
Overweight Between 25 and 29.9
Obese 30 or greater
%

Enrollment Number: ____________________________

Task 5
Write a program in C++ that prompts the user to enter their marks and assigns a grade based
on the following chart of grade marks distribution?
A 85-100
A- 80-84
B+ 75-79
B 71-74
B- 68-70
C+ 64-67
C 60-63
C- 57-59
D+ 57-56
D 50-53
F 0-49

Task 6
Write a program to find the factorial of a given number.
Test Data:
Input a number: 5
Expected Output:
120

Lab Grading Sheet:

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

2. 05

3. 05

4. 05

Total 20 Signature

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

Page 2 of 2

You might also like