0

Hey,

I am trying to complete a learning exercise for a rocket program. I already have a Rocket Class but I also need to have a new class to run the rocket program.

So far I have wrote

class RocketTest{

	public static void main(String[] args){
	
	Rocket varName = new Rocket();
	varName.methodName();
	
	 newRocket.fuelRocket();
	 newRocket.countDown(number);

    for (int number=10; number > -1; number--)

and now I need to do the following:
within each loop iteration, call the countDown method of your Rocket and pass it the new number.

Can anyone please shed any light on what I need to do??

Many Thanks
AdventureX

2
Contributors
1
Reply
2
Views
8 Years
Discussion Span
Last Post by ~s.o.s~
0
for(int number = 10; number >= 0; --number) {
  oRocket.countDown(number);
}

No?

But this seems to be logically wrong since the `driver' class shouldn't be the one performing the countdown; the rocket instance should be provided with a default counter which would be decremented and the rocket would take off when Rocket.takeOff() is called.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.