Metro City planners proposes that a community conserve its water supply by repla
ID: 3621395 • Letter: M
Question
Metro City planners proposes that a community conserve its water supply by replacing all the community's toilets with low-flush models that use only 2 liters per flush. assume that there is about 1 toilet for every three 3 persons, that existing toilets use an average of 15 liters per flush, that a toilet is flushed on average 14 times per day, and that the cost to install each new toilet is $150. write a program that would estimate the magnitude (lites/day)and cost of the water saved based on the community's population.Explanation / Answer
please rate - thanks
you didn't say how much a liter costs, so I picked a number
#include <stdio.h>
#include <conio.h>
int main()
{int pop,toilets;
double newcost,cost,saved,newliters,liters,costperliter=.03;
printf("Enter population: ");
scanf("%d",&pop);
toilets=pop/3;
if(pop%3!=0)
toilets++;
liters=toilets*15*14;
newliters=toilets*2*14;
cost=liters*costperliter;
newcost=newliters*costperliter;
saved=cost-newcost;
saved=(saved*365.-150.)/365.;
printf("liters saved per day: %.2f ",liters-newliters);
printf("dollars saved per day: $%.2f ",saved);
getch();
}