Lab-2 Journal-02-21032023-112224am
Lab-2 Journal-02-21032023-112224am
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
Objective(s):
Upon completion of this lab session, learners will be able to:
• If/Else (Conditions)
• Loop (Repetition)
Task 01:
Daraz.pk has launched a promotion for their customers who paid online payment through
credit/Debit card. According to the promotion, the purchaser will receive a discount voucher
worth 1000PKR with their monthly spending is 10,000 PKR or more than their last month
spending and their last month bill is not less than 8,000 PKR.
Task 02:
Write pseudocode for an ATM program that allows users to withdraw money from their
account. The program should prompt the user to enter their account number and PIN. If
the account number and PIN are valid, the program should display the user's current
account balance and prompt them to enter the amount they wish to withdraw. The
program should then verify that the amount to withdraw is valid (i.e., the user has enough
%
funds in their account). If the amount to withdraw is valid, the program should deduct the
amount from the user's account balance and display the new balance. If the amount to
withdraw is invalid, the program should display an error message and ask the user to try
again. After a successful withdrawal, the program should ask the user if they want to
perform another transaction or exit the program.
Requirements:
Use a for loop to allow the user to try again if they enter an invalid withdrawal amount.
Use if-else statements to validate the user's account number and PIN, as well as the
withdrawal amount.
The program should terminate if the user chooses to exit.
Task 3:
Write a program to display the n terms of odd natural number and their sum.
Sample data:
Task 4:
Task 5:
Write a program to generate Factorial sequence. The sequence starts with 1, and each
subsequent number is the product of the previous number and the next integer. For example,
the first ten numbers in the factorial sequence are: 1, 1, 2, 6, 24, 120, 720, 5040, 40320,
362880.
Task 6:
Sample data:
Input number = 13
Page 2 of 3
%
Max Obtained
Task Comments (if any)
Marks Marks
1. 05
2. 05
3. 05
4. 05
5 05
6 05
Total 30 Signature
Note: Attempt all tasks and get them checked by your Lab Instructor.
Page 3 of 3