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

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.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.