[SOLVED] An Applet

28.00 $

Programming resource
Digital learning resource
Category:
Practical programming resource
Suitable for guided study and reference
Tutor guidance available when needed

Description

5/5 - (1 vote)

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.

Resource details

Understand the Task Before You Use the Resource

Review the requirements, identify the programming concepts involved, study the implementation and test your understanding with your own examples and modifications.