Ok, so basically I need to d this java application for an assignment. It says Write a java program that uses the ASCII codes and a for loop in a METHOD Alphabet() to display the alphabet in the following format.
I'm not too good at java but this is what i got so far.
{ public static void main( String args[] ) { char upper; char lower; System.out.printf( "%s%20s\n", "UPPERCASE", "LOWERCASE"); for ( upper = 'A'; upper <= 'Z'; upper++ ) { System.out.print(upper); System.out.println(); } } }
Problem is.. I'm not even using ASCII or the Alphabet method. I need some serious help here, and i know some of you might not one to help but to those who want your help will be appreciated.
I also have it this other way;
This way it shows the alphabet but i can't manage to but them in two different rows one saying UPPERCASE and the other saying lowercase
public class Alphabet { public Alphabet() { for ( int i = 65; i < 91; i ++ ) { System.out.println("Upper Case\n"+(char)i + " " + (char)(i+32)); } } public static void main(String [] args) { new Alphabet(); } }
The output has to be like this
UPPERCASE lowercase
A a
B b
C c
. .
. .
. .
Z z
With the second code i already have a similar output... but i can't seem to add the headers UPPERCASE and lowercase.
can anyone help me with this? Thanks in advanced.