Java Reference
In-Depth Information
Programming Projects
Visit www.myprogramminglab.com to complete many of these Programming
Projects online and get instant feedback.
PP 6.1
Design and implement an application that reads an integer value
and prints the sum of all even integers between 2 and the input
value, inclusive. Print an error message if the input value is less
than 2. Prompt accordingly.
PP 6.2
Design and implement an application that reads a string from the
user and prints it one character per line.
VideoNote
Developing a solution
of PP 6.2
PP 6.3
Design and implement an application that produces a multipli-
cation table, showing the results of multiplying the integers 1
through 12 by themselves.
PP 6.4
Design and implement an application that prints the first few
verses of the traveling song “One Hundred Bottles of Beer.” Use
a loop such that each iteration prints one verse. Read the number
of verses to print from the user. Validate the input. The follow-
ing are the first two verses of the song:
100 bottles of beer on the wall
100 bottles of beer
If one of those bottles should happen to fall
99 bottles of beer on the wall
99 bottles of beer on the wall
99 bottles of beer
If one of those bottles should happen to fall
98 bottl es of beer on the wall
PP 6.5
Using the PairOfDice class from PP 4.7, design and implement
an application that rolls a pair of dice 1000 times, counting the
number of box cars (two sixes) that occur.
PP 6.6
Using the Coin class defined in this chapter, design and imple-
ment a driver class called CountFlips whose main method flips a
coin 100 times and counts how many times each side comes up.
Print the results.
PP 6.7
Create modified versions of the Stars program to print the fol-
lowing patterns. Create a separate program to produce each pat-
tern. Hint: Parts b, c, and d require several loops, some of which
print a specific number of spaces.
Search WWH ::




Custom Search