I'm having trouble writing this exercise in the Java Language, using the Eclipse IDE:
The director of a state school in the city of São Paulo is terrified of the absurd consumption of water that is occurring monthly. In order to gather information that will lead you to make cost containment decisions, she hired you to develop a program that will read the month's water consumption in m3 and report the amount of the bill. Data: consider that each m3 is worth R $ 2.00; In addition, R $ 20.00 of sewage and 15% of taxes are added.
I can not get the program to do the calculations. In my case I first have to calculate the tax, then "play" it in the formula to calculate the value of water consumption.
MY CODE
import java.io.IOException;
import java.util.Scanner;
public class Agua {
public static void main(String[] args) throws IOException {
int consumo;
int valore;
int imposto;
System.out.println("Informar o valor do consumo");
Scanner Leio = new Scanner(System.in);
consumo = Leio.nextInt();
imposto = (2 * consumo + 20) * 15/100;
System.out.println("O imposto é ");
System.out.println("Informe o valor do imposto");
valore = (2 * consumo + 20) + imposto;
System.out.println("O Valor é de: R$ ");
Leio.close();
}
}
I have difficulties in this exercise, because after I type the value of the consumption nothing happens!
Below is the formulas by VisualG where the caculars occur without problems (crazy teacher wants Portugol / Visualg and Java)!
MysecondimageisthescreeninEclipseafterIenterthevalueof"consumption"