그래서 프로그래밍 랩 실험실에 대한 소개를 위해 자동 판매기를 만들어야합니다. 지금까지 이것이 내 Java 코드의 모습입니다.기본 Java 프로그램은 Blue-J로 실행되지 않습니다
import java.util.Scanner;
public class VendingMachine
{
public static void main (String[] args)
{
Scanner keyboard = new Scanner(System.in);
final int quarter = 25;
final int dime = 10;
final int nickel = 15;
int cost = keyboard.nextInt();
int totalChange = 100 - cost;
int totalQuarters= totalChange/quarter;
totalChange = totalChange % quarter;
int totalDimes = totalChange/dime;
totalChange = totalChange % dime;
int totalNickels = totalChange/nickel;
totalChange = totalChange % nickel;
System.out.print("Enter Price for your item" + "30");
}
}
내가해야하는 것은 이것입니다.
이클립스를 추천하지만 난 블루 J이 랩을 완료 할 생각을 알고 프로그램이 블루 J..so에서 시작되지 않습니다 어떤 이유Enter a price for item (from 25 cents to a dollar, in 5-cent increments): 45
You bought and item for 45 cents and gave me a dollar, so your change is
2 quarters,
0 dimes, and
1 nickels.
값 30, 65와
하고, (100), 누구든지 어떤 조언을 해?
다른 사람들을위한 숙제를 채우기 위해 여기에 나와 있지 않습니다! (숙제 태그가 더 이상 사용되지 않기 때문에 ... 아무런 언급이 없습니다!) – t0mm13b