Results 1 to 4 of 4
- 03-28-2012, 02:43 AM #1
Member
- Join Date
- Mar 2012
- Posts
- 2
- Rep Power
- 0
please help convert this pseudo code to java
Java Code:string toprint = ""; // for each row for(int row=0; row<n; row++){ toprint = ""; if(row==0){ // leading spaces = n/2 foreach(0 to n/2) toprint += " "; toprint += "*"; } else if((row>0)&&(row<n/2)){ // leading spaces = n/2 - row number foreach((n/2)-row) toprint += " "; // 3 stars in each row>0 && row < n/2 for(int i=0; i<3; i++){ toprint +="*"; string spaces = ""; // spaces between stars = row number -1 foreach(0 to row-1) spaces += " "; toprint += spaces; } } else if(row==n/2){ foreach(0 to n){ toprint += "*"; } } else if((row>n/2)&&(row<n-1)){ foreach(0 to row-(n/2)) toprint += " "; // 3 stars in each row>n/2 && row < n-1 for(int i=0; i<3; i++){ toprint +="*"; string spaces = ""; // spaces between stars = n - row number-2 foreach(0 to n-row-2) spaces += " "; toprint += spaces; } } else if(row==n-1){ // leading spaces = n/2 foreach(0 to n/2) toprint += " "; toprint = "*"; } toprint += "\n"; } print(toprint);Last edited by JosAH; 03-28-2012 at 08:33 AM. Reason: added [code] ... [/code] tags
- 03-28-2012, 02:53 AM #2
Re: please help convert this pseudo code to java
That is absolutely not how this works. What have you tried? Where are you stuck?
How to Ask Questions the Smart Way
Static Void Games - Play indie games, learn from game tutorials and source code, upload your own games!
- 03-28-2012, 03:01 AM #3
Member
- Join Date
- Mar 2012
- Posts
- 2
- Rep Power
- 0
Re: please help convert this pseudo code to java
I've tried to do it but it didn't give me the shape it's so hard problem i tried so many answers and it just won't come out here it is Assignment01_9553.pdf
-
Re: please help convert this pseudo code to java
Few folks are going to click on a link. If you need our help, post your code here in the forum along with any error messages or misbehaviors.
Similar Threads
-
Help me re-write pseudo code?
By csisdifficult in forum New To JavaReplies: 15Last Post: 04-21-2011, 06:30 AM -
Starting Pseudo-Code For My Asignment?
By EpyonCustom in forum New To JavaReplies: 26Last Post: 04-07-2011, 11:07 AM -
pseudo code
By jamiem in forum New To JavaReplies: 4Last Post: 12-20-2010, 05:25 PM -
Convert java code to midlet code
By coldvoice05 in forum New To JavaReplies: 1Last Post: 08-12-2009, 11:14 AM -
Convert java code to midlet code
By coldvoice05 in forum Advanced JavaReplies: 1Last Post: 08-09-2009, 01:21 PM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks