Thursday, April 26, 2007

Robot sample run

F:\CS-10\PA2>java Robot
Enter small step: 2
Enter medium step: 3
Enter large step: 5
Enter distance: 20
Number of ways the robot can move a distance of 20
takings steps of length 2, 3 and 5 is: 448

F:\CS-10\PA2>java Robot
Enter small step: 3
Enter medium step: 2
Enter large step: 1
Illegal values: small < medium < large
Enter small step: 3
Enter medium step: 6
Enter large step: 9
Enter distance: 6
Number of ways the robot can move a distance of 6
takings steps of length 3, 6 and 9 is: 2

F:\CS-10\PA2>java Robot
Enter small step: 3
Enter medium step: 7
Enter large step: 17
Enter distance: 50
Number of ways the robot can move a distance of 50
takings steps of length 3, 7 and 17 is: 695

F:\CS-10\PA2>java Robot
Enter small step: 7
Enter medium step: 17
Enter large step: 34
Enter distance: 100
Number of ways the robot can move a distance of 100
takings steps of length 7, 17 and 34 is: 192

F:\CS-10\PA2>java Robot
Enter small step: 5
Enter medium step: 17
Enter large step: 53
Enter distance: 200
Number of ways the robot can move a distance of 200
takings steps of length 5, 17 and 53 is: 198045

F:\CS-10\PA2>java Robot
Enter small step: 5
Enter medium step: 13
Enter large step: 37
Enter distance: 200
Number of ways the robot can move a distance of 200
takings steps of length 5, 13 and 37 is: 5244091

F:\CS-10\PA2>java Robot
Enter small step: 5
Enter medium step: 13
Enter large step: 37
Enter distance: 25
Number of ways the robot can move a distance of 25
takings steps of length 5, 13 and 37 is: 1

F:\CS-10\PA2>java Robot
Enter small step: 5
Enter medium step: 13
Enter large step: 37
Enter distance: 12
Number of ways the robot can move a distance of 12
takings steps of length 5, 13 and 37 is: 0
F:\CS-10\PA2>

No comments: