An Applet

$27.00

Category:

Description

Java Programming

Plz write in Java

Program 1

1. Create an applet to draw a digit using the method fillRect of the class
Graphics. For instance, if the input is 4, the applet will display the digit 4, as
shown in Figure 12-27.

Program 2

2. Write a recursive method that takes as a parameter a nonnegative integer and
generates the following pattern of stars. If the nonnegative integer is 4, then
the pattern generated is:
****
***
**
*
*
**
***
****
Also, write a program that prompts the user to enter the number of lines in
the pattern and uses the recursive method to generate the pattern. For
example, specifying the number of lines to be 4 generates the preceding
pattern.