You are on page 1of 8

LabReport

DATE10/7/2023
ProgrammingFundamenta
ls
HinaJahanzeb
23-se-040
HinaGillani
Lab03:DecisionControlInstruction&CaseControlInstruction

LabTasks:

Task#1.
Given the radius of circle, write a program to find whether the area of the circle is greater
than its perimeter. (3)

Answer:

OUTPUT:

2
Programming fundamentals
Task#2
Departmental store offers 2.5% discount on shopping of 20,000 and more Rs. 1.5% discount
on shopping of 5000 Rs and more. and no discount on shopping of less than 5000 Rs to
those customers who have membership cards. Design a program that accepts total bill of
buyer and membership card(Y/N) as input and calculates amount to be paid after applying
discount. (4)

Answer:

OUTPUT:
3
Programming fundamentals
TASK#3
.Design a simple calculator using switch that prompts the user to select operator and
performs the selected operation. (3) Output should look like:
Enter two numbers ……
Enter ‘+’ for addition
Enter ‘-‘ for subtraction
Enter ‘*’ for multiplication
Enter ‘/’ for division.

Answer:

4
Programming fundamentals
OUTPUT:

5
Programming fundamentals
Conclusion:
This lab has provided valuable insights into programming fundamentals related to decision-making.
It has covered the use of nested if-else statements, else if conditions, multiple conditions in if
statements, and the switch statement. These concepts are essential for creating robust and responsive
programs capable of handling a wide range of user inputs and conditions. By completing the lab
tasks, we have gained hands-on experience in applying these concepts to real-world programming
scenarios. These skills are foundational for any programmer, and they will serve as a strong basis for
more complex programming challenges in the future.

Thankyou

6
Programming fundamentals

You might also like