Methods #2


1. Call this method to find out what your best friend wants for Christmas.


String whichPresent(String friendName) {

       //lots of code

}



2. Call this method to find out if pigs can eat bananas.


boolean doPigsEat(String food) {

       if(food.equals(“roots”)) {

              return true;

       //more code here
}
              else {return false;}

}



3. Finish this method.


int getMyLuckyNumber() {




}



4. Use these methods to figure out how many eggs you need to buy for your family.


      int eggsMomWants() {

            //some code

      }



      int eggsDadWants() {

            //some code

      }



      int eggsBabyWants() {

            //some code

      }




5. Use this method to print out the average height for a person who is your age.


      int getAverageHeight(int age) {

             if (age > 100) {

                    return 34;

             }

             if (age > 50) {

                    return 30;

             }

             if (age < 10) {

                    return 20;

             }
      }