Welcome, Guest. Please login or register.
Did you miss your activation email?
Pages: [1]   Go Down
  Print  
Author Topic: Stars  (Read 2865 times)
0 Members and 1 Guest are viewing this topic.
deAppel
Favorite member
Member
*

Reputation: 0
HappyFace plants one on you
Offline Offline
Posts: 45
Referrals: 0

Awards
« on: June 19, 2007, 08:40:56 PM »

Code
GeSHi (java):
  1.  
  2. /*--------------------------------------------------------------------------
  3. // Author List:
  4. //      deAppel <Creator>
  5. //
  6. // Description:
  7. // Do if yourself ;)
  8. //
  9. // Environment:
  10. //      This software was developed using Eclipse and Java 1.6
  11. //
  12. // Copyright Information:
  13. //      Copyright (C) 2007      <Institution><None>
  14. // Ark de Appel www.engineeringserver.com
  15. //
  16. //----------------------------------------------------------------------*/
  17. public class CLIStars {
  18. public static void main(String[] args){
  19. int row = 0;
  20. int amountOfRows = 1;
  21. String text = "x";
  22. for (int i = 0; i < row; i++){
  23. System.out.println(amountOfRows + ": " + text);
  24. text = text + "x";
  25. amountOfRows++;
  26. }
  27. }
  28. }
Created by GeSHI 1.0.7.20
Try to understand the code before compiling and running the application.

Question:
What is the possible output of this application when I change: int row = 0 into int row = 9 and compile it?

Variations:
Make it so that it will display the reverse.

Hint 1:

Post your answer(s) between the spoiler tags.
The answer(s) will be given in the next few days.
« Last Edit: June 20, 2007, 06:11:47 AM by deAppel » Logged

Earn $0.04 or more for each search you make! http://www.myhpf.co.uk/apply001.asp?Friend=77889

If you need homework help, just post your assignment and i'll code it before your deadline =) i'll provide you "t3h c0d3z" but only if you show me that you have done something and not just ask for me to write everything for you. Just tell us what the problem is and i'm sure we can fix it for you!

I was born into the Hakka lineage, A bloodline that
traces it's roots back to the original Han emperors of
China. During the rise of the 3 Kingdoms (China's
famous warring period), the Hans were overthrown
and exiled. Forced to flee, they headed south finding
refuge within the mountains of Guilin Province where
they lived under their new title, the Hakka and patiently
wait for their chance to return to the throne as the
Sons Of Heaven...
deAppel
Favorite member
Member
*

Reputation: 0
HappyFace plants one on you
Offline Offline
Posts: 45
Referrals: 0

Awards
« Reply #1 on: June 22, 2007, 08:43:45 PM »

As promised here are the (possible) answers.

Answer:


Possible variation answer:

Logged

Earn $0.04 or more for each search you make! http://www.myhpf.co.uk/apply001.asp?Friend=77889

If you need homework help, just post your assignment and i'll code it before your deadline =) i'll provide you "t3h c0d3z" but only if you show me that you have done something and not just ask for me to write everything for you. Just tell us what the problem is and i'm sure we can fix it for you!

I was born into the Hakka lineage, A bloodline that
traces it's roots back to the original Han emperors of
China. During the rise of the 3 Kingdoms (China's
famous warring period), the Hans were overthrown
and exiled. Forced to flee, they headed south finding
refuge within the mountains of Guilin Province where
they lived under their new title, the Hakka and patiently
wait for their chance to return to the throne as the
Sons Of Heaven...
Zeus
Member
*

Reputation: 0
Offline Offline
Posts: 11
Referrals: 0

Awards
« Reply #2 on: May 18, 2009, 07:35:51 PM »

thx
Logged
darkbribe
Member
*

Reputation: 0
Offline Offline
Posts: 31
Referrals: 0

Awards
« Reply #3 on: May 26, 2009, 04:32:22 AM »

Cool! I learned something =P
Logged

Hi! I kick ass.

Jormigo
Member
*

Reputation: 0
Offline Offline
Gender: Male
Posts: 51
Referrals: 0

Awards
« Reply #4 on: June 01, 2009, 11:17:26 PM »

there should be more posts like this
Logged
Arkie
Javaforums.net Admin
Senior Member
*

Reputation: 16
Developer @ Javaforums.net
Offline Offline
Posts: 2593
Referrals: 13

WWW Awards
« Reply #5 on: June 10, 2009, 04:05:51 PM »

there should be more posts like this

Feel free to start new topics wink
Logged

Java and .NET developer

To students: It doesn't matter how hard you've studied; the material won't be on the exam anyway.

Fan of http://www.retardedweblogger.com
Oh man, too much stuff to do in so little time.

http://img222.imageshack....707/arkietomatoesmall.jpg
Blizzcon 2k9 Grubby and Cassandra Ng engaged ! <3
Triple D, eerste Denken Dan Doen
Pages: [1]   Go Up
  Print  
 
Jump to:  

Your Ad Here