BS(IT) SEMESTER#01
CP LAB ASSIGNMENT # 3
UROOJ ASGHAR KHAN
ENROLLMENT # 02-135242-006
Task 1: Character Classification
Write a C++ program that checks whether a given character is a vowel, consonant, or a digit.
The program should prompt the user to enter a character and then display a message indicating
the classification.
Sample Output:
SOLUTION:
Output:
Task 2: Shopping Cart
You are developing an online shopping application for a retail store. The store wants to offer
discounts to customers based on their total purchase amount. If the total purchase amount
exceeds 15000 Rupees, a 10% discount will be applied to the customer's order.
PAGE#01
DATE:26/9/2024
, BS(IT) SEMESTER#01
CP LAB ASSIGNMENT # 3
UROOJ ASGHAR KHAN
ENROLLMENT # 02-135242-006
Write a C++ program that prompts the user to enter the total purchase amount. Based on the
entered amount, apply the appropriate discount using if-else statements and display the
discounted amount to the customer.
Sample Output:
Solution:
Output:
Task 3: Age Analysis
Assume that three friends are planning to do zip line adventure. Where age will be evaluated first
to send the younger one first. Write a C++ program where compare age of 3 friends. Find the
PAGE#02
DATE:26/9/2024
CP LAB ASSIGNMENT # 3
UROOJ ASGHAR KHAN
ENROLLMENT # 02-135242-006
Task 1: Character Classification
Write a C++ program that checks whether a given character is a vowel, consonant, or a digit.
The program should prompt the user to enter a character and then display a message indicating
the classification.
Sample Output:
SOLUTION:
Output:
Task 2: Shopping Cart
You are developing an online shopping application for a retail store. The store wants to offer
discounts to customers based on their total purchase amount. If the total purchase amount
exceeds 15000 Rupees, a 10% discount will be applied to the customer's order.
PAGE#01
DATE:26/9/2024
, BS(IT) SEMESTER#01
CP LAB ASSIGNMENT # 3
UROOJ ASGHAR KHAN
ENROLLMENT # 02-135242-006
Write a C++ program that prompts the user to enter the total purchase amount. Based on the
entered amount, apply the appropriate discount using if-else statements and display the
discounted amount to the customer.
Sample Output:
Solution:
Output:
Task 3: Age Analysis
Assume that three friends are planning to do zip line adventure. Where age will be evaluated first
to send the younger one first. Write a C++ program where compare age of 3 friends. Find the
PAGE#02
DATE:26/9/2024