У меня возникла проблема, когда я пытаюсь напечатать свои строки. Я хочу, чтобы весь println читал что-то вроде этого «BAR, ORANGE и PLUM». Строки, похоже, не взаимодействуют с оператором println. Я очень новичок в java, и я очень потерян, поэтому, пожалуйста, объясните ваши предложения очень просто. Я был бы очень признателен не только за ответ, но и за объяснение, чтобы больше не повторять эту ошибку. Спасибо за ваше время.
/*
* This program will simulate playing a slot machine.
* It will provide instructions to the user with an initial stake of $50 and then let the user play until either the money runs out or the player quits.
* Author: Zac Saunders
* Version: 1.3
*/
import acm.program.*;
import java.awt.*;
import acm.util.RandomGenerator;
public class SlotMachine_V2 extends GraphicsProgram {
RandomGenerator rgen = new RandomGenerator();
public void run(){
waitForClick();
rollWheels();
}
public void rollWheels(){
Wheel_1();
Wheel_2();
Wheel_3();
println("You rolled:"+aa, + bb, +cc"");
run();
}
public void Wheel_1(){
int a = rgen.nextInt(1, 6);
if( a == 1){//BAR//
String aa =(" BAR, ");
}else if( a == 2){//BELL//
String aa =(" BELL, ");
}else if( a == 3){//PLUM//
String aa =(" PLUM, ");
}else if( a == 4){//ORANGE//
String aa =(" ORANGE, ");
}else if( a == 5){//CHERRY//
String aa =(" CHERRY, ");
}else if( a == 6){//DASH (-)//
String aa =(" -, ");
}
}
public void Wheel_2(){
int b = rgen.nextInt(1, 6);
if( b == 1){//BAR//
String bb =("BAR, ");
}else if( b == 2){//BELL//
String bb =("BELL, ");
}else if( b == 3){//PLUM//
String bb =("PLUM, ");
}else if( b == 4){//ORANGE//
String bb =("ORANGE, ");
}else if( b == 5){//CHERRY//
String bb =("CHERRY, ");
}else if( b == 6){//DASH (-)//
String bb =("-, ");
}
}
public void Wheel_3(){
int c = rgen.nextInt(1, 6);
if( c == 1){//BAR//
String cc =("and BAR");
}else if( c == 2){//BELL//
String cc =("and BELL");
}else if( c == 3){//PLUM//
String cc =("and PLUM");
}else if( c == 4){//ORANGE//
String cc =("and ORANGE");
}else if( c == 5){//CHERRY//
String cc =("and CHERRY");
}else if( c == 6){//DASH (-)//
String cc =("and -");
}
}
}
String
. Пожалуйста. - person Sotirios Delimanolis   schedule 18.12.2013