Write an algorithm and draw a flowchart to display the total water bill charges of the month depending upon the number of units consumed by the customer as per the following criteria: • for the first 100 units @ 5 per unit • for next 150 units @ 10 per unit • more than 250 units @ 20 per unit Also add meter charges of 75 per month to calculate the total water bill.
Answers
Algorithm :
Algorithm is the step by step process of the execution of code. It is just like blue print before going to coding process.
Steps of Algorithm:
- Start.
- Using an input function, ask the user to input total number of units consumed.
- Assign meter charges of Rs. 75 to a variable that denotes meter charges.
- Initialize a variable that needs to hold units consumed charge.
- Write an if conditional statement, with a condition to check whether the units consumed are less than or equal to 100. If yes, Multiply units consumed with 5, and assign the value to charge variable.
- Else if, check if the number of units consumed are less than or equal to 250 or not. If yes, Multiply no.of units consumed with 10, assign the value to charge variable.
- Else (i.e., if no.of units consumed are greater than 250), multiply no.of units consumed with 20 and assign the value to charge variable.
- Then add the meter charges and charge on units to get the total water bill.
- Print the total water bill using output function.
- End.
NOTE : You can add a case that states no.of units consumed shouldn't be less than 0.
Flowchart :
Graphical representation of algorithm is called a Flowchart.
Have a look at the Attachment given below.
Sample program using python language :
no_of_units = int(input("Enter the no.of units consumed : "))
meter_charges = 75
if no_of_units <= 100 :
charge = no_of_units * 5
elif no_of_units <= 250 :
charge = no_of_units * 10
else :
charge = no_of_units * 20
print("Total water bill is : Rs.", charge+meter_charges)
Input 1 :
Enter the no.of units consumed : 75
Output 1 :
Total water bill is : Rs. 375
Input 2 :
Enter the no.of units consumed : 175
Output 2 :
Total water bill is : Rs. 1750
Input 3 :
Enter the no.of units consumed : 275
Output 3 :
Total water bill is : Rs. 5500
Learn more :
1. Program to perform Arithmetic operations using function.
brainly.in/question/18905944
2. Write a simple python function to increase the value of any number by a constant "C=5"
brainly.in/question/16322662
3. Write an algorithm and draw a flowchart to input name and age of a person and print a eligible. If age>18else print Not Eligible along with name
https://brainly.in/question/18370940
Answer:
Explanation:
Algorithm :
Algorithm is the step by step process of the execution of code. It is just like blue print before going to coding process.
Steps of Algorithm:
Start.
Using an input function, ask the user to input total number of units consumed.
Assign meter charges of Rs. 75 to a variable that denotes meter charges.
Initialize a variable that needs to hold units consumed charge.
Write an if conditional statement, with a condition to check whether the units consumed are less than or equal to 100. If yes, Multiply units consumed with 5, and assign the value to charge variable.
Else if, check if the number of units consumed are less than or equal to 250 or not. If yes, Multiply no.of units consumed with 10, assign the value to charge variable.
Else (i.e., if no.of units consumed are greater than 250), multiply no.of units consumed with 20 and assign the value to charge variable.
Then add the meter charges and charge on units to get the total water bill.
Print the total water bill using output function.
End.
NOTE : You can add a case that states no.of units consumed shouldn't be less than 0.
Flowchart :
Graphical representation of algorithm is called a Flowchart.
Have a look at the Attachment given below.
Sample program using python language :
no_of_units = int(input("Enter the no.of units consumed : "))
meter_charges = 75
if no_of_units <= 100 :
charge = no_of_units * 5
elif no_of_units <= 250 :
charge = no_of_units * 10
else :
charge = no_of_units * 20
print("Total water bill is : Rs.", charge+meter_charges)
Input 1 :
Enter the no.of units consumed : 75
Output 1 :
Total water bill is : Rs. 375
Input 2 :
Enter the no.of units consumed : 175
Output 2 :
Total water bill is : Rs. 1750
Input 3 :
Enter the no.of units consumed : 275
Output 3 :
Total water bill is : Rs. 5500
Learn more :
1. Program to perform Arithmetic operations using function.
brainly.in/question/18905944
2. Write a simple python function to increase the value of any number by a constant "C=5"
brainly.in/question/16322662
3. Write an algorithm and draw a flowchart to input name and age of a person and print a eligible. If age>18else print Not Eligible along with name
brainly.in/question/18370940