[英]Simple Java slots machine with if else statements [closed]
I have the following information on how the problem must be structured: Write an application that simulates a gambling slot machine.我有以下关于如何构造问题的信息: 编写一个模拟老虎机的应用程序。 In the application, perform the following tasks:
在应用程序中,执行以下任务:
Enter the dollar amount inserted into the slot machine: 100输入投入老虎机的美元金额:100
Orange Apple Cherry橙苹果樱桃
Sorry, you lost对不起,你输了
Or或者
Enter the dollar amount inserted into the slot machine: 100输入投入老虎机的美元金额:100
Orange Cherry Cherry橙樱桃樱桃
Congratulations, you won $ 100恭喜,你赢了 100 美元
this is what I've came up with so far and not sure if this is even close to correct:这是我到目前为止提出的,不确定这是否接近正确:
public static void main(String[] args) {
Scanner input = new Scanner(System.in);
int amount;
int Apple;
int Orange;
int Peach;
int Pineapple;
System.out.println("Enter the dollar amount inserted into the slot "
+ "machine");
amount = input.nextInt();
System.out.println("The dollar amount is " + amount);
Apple = 1;
Orange = 2;
Pineapple = 3;
Peach = 4;
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.