Java Chapter 6 Hands On Review

advertisement
Java Chapter 6 Hands On Review
Case
1. Create a Names application that prompts the user for a series of first names and then displays the number of
names entered and then the name with the most characters in uppercase letters. The application output should
look similar to the following:
2. Create a FlipCoin application that prompts the user to guess heads or tails or enter -1 to quit. If the user's
guess matches a computer-generated coin flip, the user wins that round. Use a random number generator to
determine the flip of the coin. The application should allow the user to continue playing until a -1 is entered.
At the end of the game, the percentage of correct guesses should be displayed.
3. Create a Sequence application that generates a series of random numbers from 0 to 9 until a 0 is generated and
then displays the length of the sequence of numbers. Program output should look similar to:
Java Chapter 6 Hands On Review
Answer Section
CASE
1. ANS:
A sample answer file corresponding to Names is stored on the Resource CD in the ASSESSMENT\HANDS-ON
ANSWERS\Ch06 Answer Names folder.
PTS: 1
TOP: The while Statement | Counters and Accumulators | The String Class | Comparing Strings
NOT: Similar to the Cities Case question in this Question Bank.
2. ANS:
A sample answer file corresponding to FlipCoin is stored on the Resource CD in the ASSESSMENT\HANDSON ANSWERS\Ch06 Answer FlipCoin folder.
PTS: 1
TOP: The do-while Statement | Counters and Accumulators
3. ANS:
A sample answer file corresponding to Sequence is stored on the Resource CD in the ASSESSMENT\HANDSON ANSWERS\Ch06 Answer Sequence folder.
PTS: 1
TOP: The do-while Statement | Counters and Accumulators
Download