CompSci 94 Fall 2024 Exam 1 Solutions 1. B) this.panda move RIGHT 1.0 2. A) Object B) TextString C) Integer OR Whole Number D) Decimal Number 3. C) this.pig move UP 1.0 4. A) The objects must look realistic 5. D) do in order this.tortoise turn LEFT 0.25 this.tortoise move BACKWARDS 1.0 6. D) do in order this.panda moveAndOrientTo this.pig this.panda move LEFT 1.0 7. A) do in order this.bunny turn LEFT, 0.5, asSeenBy this.tortoise this.tortoise turn RIGHT, 0.5 8. A) moveFast B) amount, saying, someDirection C) 2.5, "This is fun", RIGHT D) playWithFriend E) yes, SJointedModel includes Biped, it is a superclass of Biped F) paint G) The bunny turns green in color H) The tortoise is still visible, just see through. It has lost 60 percent of its visibility. 9. see drawing 10. a) One Soln (moves poodle to position) this.pandaBackView moveAndOrientTo this.panda this.pandaBackView move BACKWARD 1.5 this.pandaBackView move UP 0.5 this.pandaBackView setOpacity 0.0 ALTERNATIVE SOLN: (moves camera to position, then places poodle on top of camera) this.camera moveAndOrientTo this.panda this.camera move BACKWARD 1.5 this.camera move UP 0.5 this.pandaBackView moveAndOrientTo this.camera this.pandaBackView setOpacity 0.0 ALTERNATIVE SOLN 2: (moves camera to position different way, then places poodle on top of camera) this.camera moveTo this.panda this.camera orientToUpright this.camera turn right 0.5 this.camera move BACKWARD 1.5 this.camera move UP 0.5 this.pandaBackView moveAndOrientTo this.camera this.pandaBackView setOpacity 0.0 b) this.camera moveAndOrientTo this.pandaBackView 11. this.whiteRabbit turnToFace this.pig this.whiteRabbit move FORWARD whiteRabbit getdistanceTo this.pig -1.5 this.pig turn LEFT 0.25 this.pig turn RIGHT 0.5 asSeenBy this.whiteRabbit this.pig turnToFace this.panda this.pig say "hello there" this.pig move DOWN this.pig getHeight / 2.0 this.pig move FORWARD this.pig getDistanceTo this.panda - 0.5 this.panda setPaint ORANGE this.panda setVehicle this.pig this.pig move FORWARD 20.0 ALTERNATIVE SOLUTION this.whiteRabbit turnToFace this.pig this.whiteRabbit move FORWARD whiteRabbit getdistanceInFrontOf this.pig -1.0 this.pig turn RIGHT 0.25 this.pig turn LEFT 0.5 asSeenBy this.whiteRabbit this.pig turnToFace this.panda this.pig say "hello there" this.pig move DOWN this.pig getHeight * 0.5 this.pig move FORWARD this.pig getDistanceTo this.panda - this.panda getDepth /2.0 this.panda setPaint ORANGE this.panda setVehicle this.pig this.pig move FORWARD 20.0 12. A) declare procedure exchange with parameters: Biped friend, DecimalNumber distancePast, TextString greeting do together this turnToFace friend friend turnToFace this this say greeting this move FORWARD this getDistanceTo friend - 1.5 this move UP friend getHeight this move FORWARD 1.0 do together this move DOWN friend getHeight friend move FORWARD distancePast B) this.tortoise exchange friend: this.panda, distancePast: 6.0, greeting: "Hi Panda"