왜 루프에서 벗어나는 지 알 수 없습니다. 여기 내 프로그램이 있습니다 :Java에서 while 루프가 깨어짐
public static void main(String[] args) {
Scanner input = new Scanner (System.in);
double tution, rate, r, t, realpay, multiply, start;
start = 0;
while(start != -1)
{
System.out.print("Press 1 to start, -1 to end: ");
start = input.nextDouble();
System.out.print("Please enter the current tution fee for the year: ");
tution = input.nextDouble();
System.out.print("Enter in the amount of interest: ");
rate = input.nextDouble();
r = 1 + rate;
System.out.print("Please enter the number of years: ");
t = input.nextDouble();
multiply = Math.pow(r,t);
realpay = tution * multiply;
System.out.println("the cost of your tution fee: " + realpay);
if (start == -1)
{
break;
}
}
}
당신은 저에게 뭐가 잘못 됐는지 말해 줄 수 있습니까?
죄송합니다. 나는 AmitD에 의한 이전의 답을 보지 못했다. –
정말 고마워요! –