Basic HTML Version

|  | Table of Contents |  | View Full Version

Page 129 - 2615_KEC
P. 129

    HANDS-ON PROJECT

                     PROJECT 1: Confectionery Bill Calculation

                     Software Used: CodeSkulptor.org

                     Objective:
                     Develop a Python program to calculate the total cost of a confectionery bill by using:

                       Arithmetic operators          Variables and constants           Formatted outputs
                     The program will take dynamic input from the user for item quantities and compute the bill using
                     predefined item prices.

                     Use codeskulptor3-https://py3.codeskulptor.org/

                     Step-by-Step Instructions: (Plan IPO)
                     1.  Input: User enters item quantities (dynamic- varies with each user) and declare prices for 3
                         items (static- constant).
                     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
                         quantity. Refer to the sample

                                                       You have to pay Rs. 300 only.

                                             Code:                                              Flow:

                                                                                                Start

                                                                                        Input Item Quantity

                                                                                          Input Item Price

                                                                                Calculate Total Bill = Quantity * Price

                                                                                          Display Total Bill

                                                                                                End

                     Bonus Feature:

                         Apply Discounts: Introduce a discount mechanism that reduces the total bill by a percentage
                         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.

                                                                                            Control Structures in Python  127

| 124 125 126 127 128 129 130 131 132 133 134 |