어쨌든 나는 무식하게 들린다. 이것은 Java를 배우는 첫날입니다. 문제가 있습니다. 프로그램을 실행할 때마다.Eclipse에서 Java 용 콘솔 텍스트의 공간을 알아내는 방법을 아는 사람이 있습니까?
Eveytime 프로그램을 실행하면 "53308.0of Drew Brees의 패스 야드 is533.08Football 필드"라고 읽습니다. 숫자 "53308.08"과 "of"와 "533.08"사이에 공백을 넣는 방법을 모르겠다. 콘솔 텍스트가 어떻게되어야 하나? 내가 고칠 수 있을까? 문자열에 필요한 경우
공용 클래스 BreesPassingYardsFields { 공공 정적 무효 메인 (문자열 인수 []) {
double PassYards; // Number of career pass yards Drew Brees has.
double FieldLength; // Number of yards in a football field
double FootballFields; // The amount of football fields Drew Brees has thrown for
PassYards = 53308; // Start with Drew Brees' Pass Yards
FieldLength = 100; // Length of a football field
FootballFields = PassYards/FieldLength; // converts to how many Football Fields Drew Brees has thrown for
System.out.println(PassYards + "of Drew Brees' Pass Yards is" + FootballFields + "Football Fields");
}
}