Page 111 - KEC Khaitan C8.5 Flipbook
P. 111

PROJECT NAME 2: Square Geometry Calculator

 HANDS-ON PROJECT  Software Used: CodeSkulptor
                 Objective:
 PROJECT NAME 1: Confectionery Bill Calculation  Develop a Python program to calculate the area and perimeter of a square by using:

 Software Used: CodeSkulptor.org     Arithmetic operators        Variables and constants        Formatted outputs

 Objective:      This program will take dynamic input for the side length of the square and display the calculated
                 area and perimeter.
 Develop a Python program to calculate the total cost of a confectionery bill by using:
                 Use Codeskulptor3-https://py3.codeskulptor.org/
    Arithmetic operators        Variables and constants        Formatted outputs
 The program will take dynamic input from the user for item quantities and compute the bill using   Step-by-Step Instructions: (Plan IPO)
 predefined item prices.  1.  Input: User enters the side length of the square (dynamic - varies with each user).

 Use codeskulptor3-https://py3.codeskulptor.org/  2.  Process: Use the formula for area:
 Step-by-Step Instructions: (Plan IPO)     Area=side x side         Perimeter = 4 x side       Side=3 units

 1.  Input: User enters item quantities (dynamic- varies with each user), and declare prices for 3   3.  Output: Display the total area and perimeter in the given format   Area= 9 units
 items (static- constant).  after entering the value for the side. Refer to the sample         Perimeter= 12 units.
 2.  Process: Calculate total bill using quantities, prices.
 3.  Output: Display the detailed bill with total cost in given format after entering the values for   Code:  Flow:
 quantity. Refer to the sample
                                                                                               USER
 You have to pay Rs. 300 only.                                                               ENTERS SIDE
                                                                                              LENGTH
 Code:  Flow:

 Start                                                                                     CALCULATE AREA



 Input Item Quantity                                                                     CALCULATE PERIMETER


                                                                                          DISPLAY TOTAL AREA
 Input Item Price

                                                                                        DISPLAY TOTAL PERIMETER
 Calculate Total Bill = Quantity * Price



 Display Total Bill                                                                           PROCESS
                                                                                             COMPLETE

 End

                 Bonus Feature:
 Bonus Feature:      Decimal Values: Modify the program to accept and calculate side lengths with decimal values
                     for more accuracy.
    Apply Discounts: Introduce a discount mechanism that reduces the total bill by a percentage      Rounded Output: Display results up to two decimal places to maintain precision.
 if the amount exceeds a certain limit (e.g., 10% discount for bills over Rs. 500).

    Display Discounted Bill: Show the original bill, the discount applied, and the final amount
 payable.


                                                                                                 Hands-On Project  109
   106   107   108   109   110   111   112   113   114   115   116