Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Q8) please I want the right answer :) “Metro City Planners proposes that a commu

ID: 3630315 • Letter: Q

Question

Q8) please I want the right answer :)

“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 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 (liters/day) and cost of the water saved based on the community’s population.”

Explanation / Answer

import java.util.*; class Metro{ public static void main(String[] args) { int pop = 0; int noT = 0; int cost = 150; int save = 182; Scanner sc = new Scanner(System.in); System.out.print("Enter the population: "); pop = sc.nextInt(); noT = pop/3; cost *= noT; save *= noT; System.out.printf("The magnitude is %d liters/days and the cost of water is $%d for a population of %d.", save,cost,pop); System.out.println(); } }