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