package pack3;
public class PohamCar {
int speed=0;
String ownerName, turnShow;
PohamHandle handle;
public PohamCar() {
}
public PohamCar(String name) {
ownerName=name;
handle=new PohamHandle();
}
void playHandle(int q) {
if(q>0) turnShow= handle.righttTurn(q);
else if(q<0) turnShow= handle.leftTurn(q);
else if(q==0) turnShow= handle.stright(q);
}
}
package pack3;
public class PohamCarMain {
public static void main(String[] args) {
PohamCar tom=new PohamCar("tom");
tom.playHandle(0);
System.out.println(tom.ownerName+"의 회전량은 "+tom.turnShow+" "+ tom.handle.quantity);
tom.playHandle(-15);
System.out.println(tom.ownerName+"의 회전량은 "+tom.turnShow+" "+ tom.handle.quantity);
System.out.println();
PohamCar james=new PohamCar("james");
james.playHandle(-1);
System.out.println(james.ownerName+"의 회전량은 "+james.turnShow+" "+ james.handle.quantity);
}
}