Go Back   CodingForums.com > :: Server side development > Java and JSP

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 07-12-2012, 03:24 AM   PM User | #1
itsalltech
New Coder

 
Join Date: Mar 2010
Posts: 22
Thanks: 1
Thanked 0 Times in 0 Posts
itsalltech is an unknown quantity at this point
Using nested loops and constant values to draw figure

Write a Java program in a class named Window that produces the preceding figure as output. Use nested for loops to print the repeated parts of the figure. Once you get it to work, add one class constant to your program so that the size of the figure can be changed simply by changing that constant's value. The example output shown is at a constant size of 3, but if you change the constant, the figure should grow larger and wider proportionally.

+===+===+
| | |
| | |
| | |
+===+===+
| | |
| | |
| | |
+===+===+

Any help would be appreciated. Thank you!
itsalltech is offline   Reply With Quote
Old 07-12-2012, 12:46 PM   PM User | #2
alykins
Senior Coder

 
alykins's Avatar
 
Join Date: Apr 2011
Posts: 1,608
Thanks: 37
Thanked 183 Times in 182 Posts
alykins will become famous soon enough
well everything is in set's of three's... so does everything grow so there would be 4 +'s wide and 4 +'s high and so on?
eg
Code:
+====+====+====+
||||
||||
||||
||||
+====+====+====+
||||
||||
||||
||||
+====+====+====+
||||
||||
||||
||||
+====+====+====+
now is doesn't look like an E anymore- so need to clarify that. This is going to be similar to the last project you did, you need to do some loops. Post what you have so far.
__________________

I code C hash-tag .Net
Reference: W3C W3CWiki .Net Lib
Validate: html CSS
Debug: Chrome FireFox IE
alykins is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 07:50 AM.


Advertisement
Log in to turn off these ads.