{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

homework5 - 15-100 HOMEWORK 5 FALL 2007 Answer the...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
15-100 HOMEWORK 5 - FALL 2007 Answer the following questions on paper and hand in at the start of class on the due date indicated. 1. A spinner is implemented with a Java class named Spinner with the following API: public Spinner() Creates a new spinner with the numbers 1 to 10 on it, initially pointing to 1. public void spin() Spins the spinner to some random value. public int getSpinValue() Returns the value currently being pointed to on the spinner. Write a Java code fragment that creates a spinner, and spins the spinner repeatedly until the number 7 is spun a total of three times. You should print out each number that is spun. 2. A "captcha" is a distorted string of characters that is displayed on the screen if an access to a chat room or a request for an email account is received. It is very hard for a computer program to read the text, but humans can read it easily. Captchas are designed to prevent automated programs from gaining access to chat rooms or new email accounts. (By the way, captchas were invented at Carnegie Mellon University!) Here is a sample captcha:
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}