Question: Do the following: Generate two random numbers from - 1 0 0 to 1 0 0 . This will be Petey's X , Y coordinate.

Do the following:
Generate two random numbers from -100 to 100. This will be Petey's X, Y coordinate.
Print out the generated X, Y coordinate
Ask the user for our X, Y coordinates as integers
Determine the distance between Petey and us. Use the Math library to determine the distance.
If that distance is 50 of less print out: "Oh no! Petey is near!". Otherwise, print "No Petey in sight."

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!