Calculate the price of water and fines of the subscribers based on consumption
Write a program that, based on the following rules, calculates the cost of the subscribers' water consumed and determines the relevant exemption or penalty.
In this program, the following should be considered:
- Subscribers with consumption of less than 21 cubic meters are exempt from paying water.
- Subscribers with consumption of between 21 and 41 cubic meters will be subject to a 5 % fine.
- Subscribers will be fined 10 % with consumption of more than 41 cubic meters.
- The amount per cubic meter of water consumed is 111 tomans.
The program must first calculate the price of the water consumed and then determine the amount of fines or exemptions based on the amount of subscribers consumption.
For example, if a subscriber consumes 30 cubic meters of water, the price of water consumed as follows:
بهای آب مصرفی = 30 * 111
Then, given that his consumption is between 21 and 41 cubic meters, a 5 % fine is calculated and added to the water price.
Finally, the program must produce the following output:
مبلغ بهای آب مصرفی: ...
مبلغ جریمه: ...
Please note that the program must be designed to receive water intake from the user and perform the calculations correctly.
 
                
                 
                 
             
                 
                        
                             Python
                                  Python
                     C#
                                  C#