Starting from:

$20

Program to produce shapes out of Unicode characters Solution

Write a program to produce shapes out of Unicode characters.
The program displays a user menu which asks a user to select a shape:
1 - Square
2 - Diamond
*****The program then asks the user to enter any character with which to fill the shape, such as *, or enter nothing for the program's default character set. This default entails filling the shape with the characters of the alphabet according to their sequential Unicode decimal value (see http://unicodelookup.com ). Therefore, the number of characters in each shape should at least accommodate the entire alphabet. For example, a square might look like:
A B C D E F
G H I J K L
M N O P Q R
S T U V W X
Y Z a b c d
e f g h i j
Your program must draw these shapes iteratively – that means using loops with integers to create and generate your letters. You do not get to use Swing's pre-built shape methods. If you want output in applet form, you must adjust coordinates such as in g.drawString(“ ”, x, y) with each loop iteration. It is preferred that you submit the program in non-applet (command-line) form.

More products