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.
Use this boilerplate code as a starting point:
Remember to add a comment before a subprogram or selection statement to explain its purpose.
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.
Use these resources as a reference to help you meet the success criteria.
Run the unit tests below to check that your program has met the success criteria.
Enter the nitrate level from the test: 50
For 50.0 nitrate dose 3 ml of carbon.
Enter the nitrate level from the test: 7.25
For 7.25 nitrate dose 2 ml of carbon.
Enter the nitrate level from the test: 2
For 2.0 nitrate dose 1 ml of carbon.
Enter the nitrate level from the test: 0.5
For 0.5 nitrate dose 0.5 ml of carbon.
Check that you have: