Answer the question
In order to leave comments, you need to log in
Method repetition in Java?
There is a working program.
packagetest;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
/**
* Created by
*/
public class otchet {
public static void main(String[] args) throws IOException {
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
double a = Integer.parseInt(reader.readLine());
double c = ((a / 87)*100);
double d = ((c/100)*13);
double e = (cd);
System.out.println(c + " Salary" );
System.out.println(d + " 13 percent");
System.out.println(e + " Verification");
}
}
Enter a number and get an answer.
What needs to be added so that after the output, the program starts again? Those. to enter a new number (the old one should remain).
p.s. I'm new to Java, don't throw stones.
Answer the question
In order to leave comments, you need to log in
В дополнение к ответу Rodgenk:
public static void main(String[] args) throws IOException {
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
String line = reader.readLine();
while (!"exit".equals(line)) {
double a = Integer.parseInt(line);
double c = ((a / 87) * 100);
double d = ((c / 100) * 13);
double e = (c - d);
System.out.println(c + " Оклад");
System.out.println(d + " 13 процентов");
System.out.println(e + " Сверка");
reader = new BufferedReader(new InputStreamReader(System.in));
line = reader.readLine();
}
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question