Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

A method named calculateAverageTreeCrown that will accept two double values (sma

ID: 3751097 • Letter: A

Question

A method named calculateAverageTreeCrown that will accept two double values (smallest crown and largest crown) and return their average as a double.

A method named calculateBigTreePoints that will accept three parameters (circumference, height, average crown spread, in that order) and return the points as a double based on the formula above. The parameters types will be String or double.

A method named displayReport that will accept six parameters (common name, scientific name, circumference, height, average crown spread, and points, in that order) and display the following Big Tree report, but return nothing. The parameter types will be String or double.

Code is not compiling and I don't understand why

public class BigTree {



   public static double calculateAverageTreeCrown(double smallestCrown, double largestCrown ){
  
  
   return((smallestCrown + largestCrown)/2.0);

}
   public static double calculateBigTreePoints(double circumference, double height, double average crown spread){
  
  
   return ((circumfrence + height + average crown spread)/3.0);
  
  
   }


public static void displayReport(String commonName, String scientificName, double circumference, double height, double average crown spread, double points) {


   System.out.println("Big Tree Report: ");
  
   System.out.println("Common Name is" +commonName);
  
   System.out.println("Scientific Name is" +scientificName);
  
   System.out.println("Circumference is" +circumference);
  
   System.out.println("Height is" +height);
  
   System.out.println("Average crown spread is" +average crown spread);
  
   System.out.println("Points is" +points);
  
   }
  
}

Explanation / Answer

public class BigTree

{

   public static double calculateAverageTreeCrown(double smallestCrown, double largestCrown ){

       return((smallestCrown + largestCrown)/2.0);

    }

   

    // variables can't contain space

    public static double calculateBigTreePoints(double circumference, double height, double average_crown_spread){

        // variable name of circumference was written wrong

        return ((circumference + height + average_crown_spread)/3.0);

  }

    // variables can't contain space

    public static void displayReport(String commonName, String scientificName, double circumference, double height, double average_crown_spread, double points) {

       System.out.println("Big Tree Report: ");

      

       System.out.println("Common Name is" +commonName);

     

       System.out.println("Scientific Name is" +scientificName);

     

       System.out.println("Circumference is" +circumference);

     

       System.out.println("Height is" +height);

     

        // variables can't contain space

       System.out.println("Average crown spread is" +average_crown_spread);

     

       System.out.println("Points is" +points);

     

   }

}

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote