0
이 코드를 작동 시키려면 어떻게해야합니까? 3 가지 시나리오의 진술을 반환해야합니다. 현재 String robotInfo에서 오류가 발생합니다.Return 문
String generateStatusReport(Robot robot) {
String robotStatus;
String robotWall;
String robotGround;
String robotInfo = robotStatus + robotWall + robotGround;
if(isRobotDead(robot)) {
robotStatus = ("The robot is dead.");
} else {
robotStatus = ("The robot is alive.");
if(isRobotFacingWall(robot)) {
robotWall = ("The robot is facing a wall.");
} else {
robotWall = ("The robot is not facing a wall.");
}
if(isItemOnGroundAtRobot(robot)) {
robotGround = ("There is an item here.");
} else {
robotGround = ("There is no item here.");
}
}
return robotInfo;
}