Java Eclipse Sections 1-5 Quiz

 

 

You may look at previous examples of code to help you with your program but you cannot copy and paste from other code examples. You may access the Java API at anytime.

Here is the problem:
1. Prompt the user for the charcter they would like to print.
2. Prompt the user for the number of lines of this character they would like to print.
3. Print that number of lines with each new line adding a character until the number of characters is the same as the number of lines requested.
In order to print characters on the same line you will need to use the
System.out.print() method which is the same as the System.out.println() method but without the built in line return.
4. Be sure your variables are named correctly and your code is properly commented.
This program will involve nested loops.

Here is what your output should look like.

What character would you like to print?
&
How many lines would you like to print?
5
&
&&
&&&
&&&&
&&&&&


The program is brought to you by ....

 

For extra credit create something that will look like this:

What character would you like to print?
&
How many lines would you like to print?
5
&
&&
&&&
&&&&
&&&&&
&&&&&
&&&&
&&&
&&
&