Reducing nitrate with carbon dosing in a fish tank.
★★☆When keeping fish, one of the goals to reduce algae is to keep nitrates to a minimum. One way of doing this is to dose a carbon source which nitrifying bacteria within an aquarium consume together with nitrates. The carbon source must be dosed very precisely.
Write a program that outputs how much carbon to dose from the nitrate. Greater than 10 is 3ml, greater than 2.5 is 2ml, greater than 1 is ml, or 0.5ml if the nitrate is equal to or less than 1.
Remember to add a comment before a subprogram or selection statement to explain its purpose.
calculate_dose so that it:Enter the nitrate level from the test: 25
For 25.0 nitrate dose 3 ml of carbon.
Enter the nitrate level from the test: 6
For 6.0 nitrate dose 2 ml of carbon.
Enter the nitrate level from the test: 1.25
For 1.25 nitrate dose 1 ml of carbon.