0% found this document useful (0 votes)
4 views

Lab-3 Journal-03-21032023-112253am

The document is a lab journal for a Computer Programming course at Bahria University, detailing various programming tasks for students to complete. It includes objectives, specific tasks involving arithmetic operations, percentage calculations, temperature conversions, and conditional statements in C++. The lab is graded out of a total of 35 marks, with a grading sheet provided for evaluation.

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)
4 views

Lab-3 Journal-03-21032023-112253am

The document is a lab journal for a Computer Programming course at Bahria University, detailing various programming tasks for students to complete. It includes objectives, specific tasks involving arithmetic operations, percentage calculations, temperature conversions, and conditional statements in C++. The lab is graded out of a total of 35 marks, with a grading sheet provided for evaluation.

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/ 4

Bahria University, Lahore Campus

Department of Computer Science


Lab Journal 03

Course : Computer Programming - Lab Date: _______________


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

Name: _____________________ Enroll No: ___________________ Class: _____________

CLO1 Demonstrate the understanding of programing language PLO2:Knowledge for Solving Computing
syntax and its usage Problems
CLO2 Apply basic programming structures for logic construction PLO3:Problem Analysis
CLO3 Translate the devised solutions into computer programs and PLO5:Modern Tool Usage
test the implementation

ARITHMETIC OPERATORS, ASSIGNMENT OPERATOR AND


IF/ELSE

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

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

Enrollment Number: ____________________________

Task 02:
Write a program that prompt user to input 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 03:
Write a program that converts Celsius temperatures to Fahrenheit temperatures. The
formula is:
F= (9/5)*C+32
F is the Fahrenheit temperature and C is the Celsius temperature.

Task 04:
Write a C++ program that prompts the user to enter an integer and determines if it's even or
odd using only if and else statements.

Task 05:

Write a C++ program that prompts the user to enter their income and calculates the tax based
on the following brackets:

0% for income up to 10,000

10% for income between 10,001 and 50,000

20% for income between 50,001 and 100,000

30% for income over 100,000

Your program should output the calculated tax amount.

Task 06:
Page 2 of 4
%

Enrollment Number: ____________________________

Write a C++ program that takes an integer input representing the day number and outputs the
corresponding day of the week using only if statements. The program should prompt the user
to enter a number between 1 and 7, and output the corresponding day of the week based on
the following conditions:

If the input is 1, output "Monday".

If the input is 2, output "Tuesday".

If the input is 3, output "Wednesday".

If the input is 4, output "Thursday".

If the input is 5, output "Friday".

If the input is 6, output "Saturday".

If the input is 7, output "Sunday".

If the input is not between 1 and 7, output "Invalid input. Please enter a number between 1
and 7."

Task 07:

Write a C++ program that takes an integer input and outputs whether it's a Saturday, Sunday,
or Monday. The program should calculate the number of days since Monday using the %
operator and output the corresponding day of the week based on the following conditions:

If the number of days since Monday is 0, output "Monday".

If the number of days since Monday is 1, output "Tuesday".

If the number of days since Monday is 2, output "Wednesday".

If the number of days since Monday is 3, output "Thursday".

If the number of days since Monday is 4, output "Friday".

If the number of days since Monday is 5, output "Saturday".

If the number of days since Monday is 6, output "Sunday".

Page 3 of 4
%

Enrollment Number: ____________________________

Lab Grading Sheet:

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

2. 05

3. 05

4. 05

5 05

6 05

7 05

Total 35 Signature

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

Page 4 of 4

You might also like