• Post Reply Bookmark Topic Watch Topic
  • New Topic

Java whatever  RSS feed

 
kenneth gonzales
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi! I'm new in java programming...My friend gave me this challenge to work with as a beginner.

But I cant do it.

Can anyone help how to make this program ?

Enter a Character: *
Enter a Number: 5

* * * * * *
* * * * *
* * * *
* * *
* *
*

Or

Enter a Character: #
Enter a Number: 4

#
# #
# # #
# # # #
 
John Damien Smith
Ranch Hand
Posts: 357
22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The first question that anybody is going to ask for questions such as this is "What have you tried?"
Post your solution attempt even if it's wrong, show any error output or error traces your solution generates.
You will learn more from correcting your own solution than from reviewing another persons solution.
 
Mike Simmons
Ranch Hand
Posts: 3090
14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A couple more things to consider:

In your first example, what does the input number 5 have to do with the output? Were there supposed to be 5 lines output, because of the 5? Because what you showed was 6 lines, and we can't tell what the intent was there.

In one example, the output lines go from longest to shortest. In the next example, they instead go from shortest to longest. Is that intentional? Are they both supposed to be going the same way? Or if not, how should we know whether the user wants lines in increasing length or decreasing length?
 
Campbell Ritchie
Marshal
Posts: 56599
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
And welcome to the Ranch
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!