Welcome, Guest. Please login or register.
Did you miss your activation email?

Advertisements recommended by javaforums.net!
Your Ad Here
Pages: [1]   Go Down
  Print  
Author Topic: Stars  (Read 1190 times)
0 Members and 1 Guest are viewing this topic.
Welcome to the Javaforums.net forums. You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today! If you have any problems with the registration process or your account login, please contact us.
deAppel
HappyFace plants one on you
Favorite member
Member
****

Reputation: 0
Offline Offline

Posts: 45
Referrals: 0

Posting Frequency



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...
Javaforums.net :: A Java Programming Forums community for developers from all around the world!
« on: June 19, 2007, 08:40:56 PM »


Advertisements recommended by javaforums.net!
 Logged
deAppel
HappyFace plants one on you
Favorite member
Member
****

Reputation: 0
Offline Offline

Posts: 45
Referrals: 0

Posting Frequency



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...
Javaforums.net :: A Java Programming Forums community for developers from all around the world!
« Reply #1 on: June 22, 2007, 08:43:45 PM »

Linkpartners recommended by javaforums.net!
 Logged
Zeus
Member
*

Reputation: 0
Offline Offline

Posts: 11
Referrals: 0

Posting Frequency



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

thx
  Logged
darkbribe
Member
*

Reputation: 0
Offline Offline

Posts: 31
Referrals: 0

Posting Frequency



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

Cool! I learned something =P
  Logged

Hi! I kick ass.

Jormigo
Jr. Coder
**

Reputation: 0
Offline Offline

Gender: Male
Posts: 51
Referrals: 0

Posting Frequency



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

there should be more posts like this
  Logged
HappyFace
Software engineer
Javaforums.net admin
Sr. Coder
*****

Reputation: 13
Offline Offline

Posts: 2021
Referrals: 5

Posting Frequency



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 developer (java4/5/6, ejb 2.1/3.0 etc) and currently trying to learn .NET (c#/asp.net)
It doesn't matter how hard you've studied; the material won't be on the exam anyway. Spread out the word and let your family, friends, colleagues, pets or your worst enemy know about www.javaforums.net / www.engineeringserver.com / www.retardation-foundation.com!
http://engineeringserver.com/XMA-NaN/

http://img254.imageshack....s/img254/9324/kbanner.png
Need me to code your homework/lab assignment etc  for whatever reason ? Sure, pm me with the info + deadline + offer etc and maybe we can work it out.
What.The.Bleep.Do.We.Know.avi =)
Javaforums.net :: A Java Programming Forums community for developers from all around the world!
   


Advertisements recommended by javaforums.net!
Your Ad Here
 Logged
Pages: [1]   Go Up
  Print  
 
Jump to:  

www.engineeringserver.com/blog :: www.uitstekendeaccu.nl :: www.bevoegdheid.nl :: Recommended books by Javaforums.net :: www.retardation-foundation.com :: Java Examples - Learn Java Programming by Examples