473,466 Members | 1,370 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

addNavigatorToTeam

1 New Member
Hi I really need help I have triedf to make this method work and need some
guidance??

I have tried many ways to make this method work but I'm stuck completely

This is how the method is suppose to work

The int argument in the method is either 1 or 2 which represents the aliens
number in the AlienSpaceTeam.
So if the argument is 1 than a new alien will be assigned to the instance variable
navigator1
This method should assume that the alienSpaceTeam with this name already
exist, But should only add a navigator to that navigator number in the
AlienSpaceTeam if that number isnt currently occupied.If it is not occupied it should be reported in the displayPane.

I would really appreciate any help
Expand|Select|Wrap|Line Numbers
  1. public void addNavigatorToTeam(String alienName,String alienPlanet,String alienTeamName,int navigatorNumber)
  2.    {
  3.       Alien navigator = new Alien(alienName,alienPlanet);
  4.       AlienSpaceTeam name = new AlienSpaceTeam(alienTeamName);
  5.       if(navigator == name.getNavigator(1))
  6.       {
  7.          navigator = new Alien(alienName, alienPlanet);
  8.       }
  9.       if (navigatorNumber == 1)
  10.       {
  11.          navigator = new Alien(alienName, alienPlanet);
  12.       }
  13.       else
  14.       {
  15.          if (navigatorNumber == 2)
  16.          {
  17.             navigator = new Alien(alienName, alienPlanet);
  18.          }
  19.       }
  20.  
  21.    }
  22.  
  23.  
Apr 29 '10 #1
0 1901

Sign in to post your reply or Sign up for a free account.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.