Write a program which counts the number of times a given


1. Write a program which counts the number of times a given letter (supplied by the user) appears in a file. Hint: Use .charAt() and the File class.

2. Write a program which prints the following columns: the first 100 whole positive numbers, their corresponding squares, their corresponding cubes. Have the numbers be formatted flush right and have the first column be of width 8, the second of width 10, and the third of width 13. The first column should have the title "number", the second, "square", the third, "cube".

3. Write a 12 times multiplication table. The first row must have the numbers from 1 to 12, as must the first column. The top row much be separated from the rest of the table by a horizontal line. The first column should be separated from the rest of the table by a vertical line.

4. Model a game of dice in which the user plays the computer. They each start with $100 and place bets until the other side is wiped out. The bets are entered by the user through the keyboard and by the computer by a randomly generated value which must be less than what each have in their possession. The roll of the dice is randomly generated.For extra credit, the winner prints an appropriate message from a random bank of messages.

Solution Preview :

Prepared by a verified Expert
JAVA Programming: Write a program which counts the number of times a given
Reference No:- TGS02393608

Now Priced at $15 (50% Discount)

Recommended (96%)

Rated (4.8/5)