English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

I am having a hard time in java and I cant put together this simple home work.

I need to write a program that will recive a word turn it to uppercase letters and print each letter in 3x5 blocks.

please post the program or teach me how to solve this. Thanks Merry Christmas, Happy new Year!!!


the result is something like this example:

Input word: cat

Output:

CCCCC AAAAA TTTTT
CCCCC AAAAA TTTTT
CCCCC AAAAA TTTTT

2006-12-24 21:09:03 · 2 answers · asked by wata_tempora 1 in Computers & Internet Programming & Design

2 answers

You may want to start by reading each character (not word) from your input and assign them to variables, or possibly an array.

Now, IIRC, in Java you can add a value to a char and change a lowercase letter to an uppercase letter (I think its around 32, you will want to double check that). Then use a set of loops to print out the output (have a loop that runs for three times and in the loop have another loop to print the letters. )

This is just a suggestion. There may be a better way.

2006-12-24 21:19:43 · answer #1 · answered by Bryan A 5 · 0 0

plz check whether ur doin the programes in bin directory or not becoz ur calss path is set to bin directory cd jdk1.4 cd bin javac filename.java java fileaname

2016-05-23 05:23:53 · answer #2 · answered by Anonymous · 0 0

fedest.com, questions and answers