Namhoon Lee

Greenhorn
+ Follow
since Sep 16, 2004
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Namhoon Lee

Sorry about cross-posting agian. And Thank you all for reading and answering my question. It really helped me a lot.
I think I'm gonna have to bother you guys often =) Thank you again~!

c.f> I will cross-post this so that I can thank everyone.
19 years ago
Oh..yeah.. It's my bad. I was just so desperate that I put same threads on many boards, hoping to get more replies. Sorry about this.
19 years ago
Oh..sure=)
Thank you for advice.
And I used both 'for' and 'while' statement this time.
It works ok when I use 'javac'in MS-DOS to operate it. But when I use 'java' to get the answer, it just stops there. It doesn't show any error messages and doesn't show any answers either. What do you think
its problem is? (It's second one in problem #1)
-----------------------------------------------------------------------
public class ThreeX2
{
public static void main (String[] org )

{
System.out.println ();
int sum=0;
int count = 0;

for (int startValue =2; startValue <=99; startValue ++)
while (startValue >1)
{
count ++;
if (startValue % 2 == 0)
startValue = startValue/2;
else
startValue = 3*startValue +1;
sum += sum + count;
}
System.out.println ( count );
}
}
------------------------------------------------------------------
I just don't get how I'm supposed to use 'for' statement in this case.
Am I using 'for' right way?
-------------------------------------------------------------------
And for third one in program #1, Would you give me any idea what kind of method I should use? I can't think of anything to start with.
19 years ago
Hi.
I'm taking AP Computer Scinece AB in high school now.
I've been assigned many programs so far. But.. I can't figure them out.
There are two programs I need your help. So..Please!!! Help Me!!!
Please!! Enjoy helping me!


<Program #1>
It's divided into three small programs and I've figured out one of them, which was the easiest one..You will be able to see the programs if you click on the link below.

(page1)
http://iboard3.superboard.dreamwiz.com/board.cgi?db=90_darkoo&idx=2&page=1

(page2)
http://iboard3.superboard.dreamwiz.com/board.cgi?db=90_darkoo&idx=3&page=1


<Program #2>
http://iboard3.superboard.dreamwiz.com/board.cgi?db=90_darkoo&idx=4&page=1

---------------------------------------------------------

The way I figured out first part of program #1 was like this :

public class ThreeX1
{
public static void main ( string[] org )
{
system.out.println ();
int startValue = 21;
int count = 0;
while (startValue >1)
{
count ++;
if (startValue % 2 == 0)
startValue = startValue/2;
else
startValue = 3*startValue +1;
}
system.out.println ( count );
}
}

===================================================

From there, for the second and third programs of program #1, I tried to figure it out by using 'for' statement instead of 'while', but I couldn't.
So..Please help me out.. Thank you

or you can e-mail me too. It would be great too.
add. : darkoo311@yahoo.com
19 years ago
Hi.
I'm taking AP Computer Scinece AB in high school now.
I've been assigned many programs so far. But.. I can't figure them out.
There are two programs I need your help. So..Please!!! Help Me!!!
Please!! Enjoy helping me!


<Program #1>
It's divided into three small programs and I've figured out one of them, which was the easiest one..You will be able to see the programs if you click on the link below.

(page1)
http://iboard3.superboard.dreamwiz.com/board.cgi?db=90_darkoo&idx=2&page=1

(page2)
http://iboard3.superboard.dreamwiz.com/board.cgi?db=90_darkoo&idx=3&page=1


<Program #2>
http://iboard3.superboard.dreamwiz.com/board.cgi?db=90_darkoo&idx=4&page=1

---------------------------------------------------------

The way I figured out first part of program #1 was like this :

===================================================

From there, for the second and third programs of program #1, I tried to figure it out by using 'for' statement instead of 'while', but I couldn't.
So..Please help me out.. Thank you

or you can e-mail me too. It would be great too.
add. : darkoo311@yahoo.com

[ edited to preserve formatting using the [code] and [/code] UBB tags -ds ]
[ September 22, 2004: Message edited by: Dirk Schreckmann ]
19 years ago