Answered step by step
Verified Expert Solution
Question
1 Approved Answer
zy Section 2.1 - IT 145: Intro to C Home D21 Module Two - IT-145-X5903 Hi I'm getting an error when | IT_145_2.2.3_Method_definiti |
zy Section 2.1 - IT 145: Intro to C Home D21 Module Two - IT-145-X5903 Hi I'm getting an error when | IT_145_2.2.3_Method_definiti | + learn.zybooks.com/zybook/IT-145-X5903-OL-TRAD-UG.22EW5/chapter/2/section/1 Apps mySNHU Login Yahoo D2L Homepage - South... Mail - Syjud, Micha... zy IT 140: Introduction... zy IT 145: Intro to Soft... =zyBooks My library > IT 145: Intro to Software Development home > 2.1: User-defined method basics Course Hero TestOut LabSim Stack Overflow - W... zyBooks catalog Help/FAQ Michael Syjud 8 9 10 public static void main(String[] args) { Scanner scnr = new Scanner(System.in); 11 double userLength; 12 double userWidth; 13 double userHeight; 14 15 userLength = scnr.nextDouble(); 16 17 18 19 userWidth = scnr.nextDouble(); userHeight = scnr.nextDouble(); System.out.println("Volume: " + pyramidVolume (user Length, userWidth, userHeight)); 20 } 21 } Run Failed to compile CalcPyramidVolume.java:9: error: illegal start of expression public static void main(String[] args) { ^ 1 error Note: Although the reported line number is in the uneditable part of the code, the error actually exists in your code. Tools often don't recognize the problem until reaching a later line. View your last submission ^ All tests passed 81F Mostly cl... ^ )) 6:56 PM zy Section 2.1 - IT 145: Intro to C Home D21 Module Two - IT-145-X5903 Hi I'm getting an error when | IT_145_2.2.3_Method_definiti | + learn.zybooks.com/zybook/IT-145-X5903-OL-TRAD-UG.22EW5/chapter/2/section/1 Apps mySNHU Login Yahoo D2L Homepage - South... Mail - Syjud, Micha... zy IT 140: Introduction... Zy IT 145: Intro to Soft... Course Hero TestOut LabSim Stack Overflow - W... =zyBooks My library > IT 145: Intro to Software Development home > 2.1: User-defined method basics zyBooks catalog ? Help/FAQ Michael Syjud H CHALLENGE ACTIVITY 2.1.3: Method definition: Volume of a pyramid. Define a method pyramidVolume with double data type parameters baseLength, baseWidth, and pyramid Height, that returns as a double the volume of a pyramid with a rectangular base. Relevant geometry equations: Volume = base area x height x 1/3 Base area = base length x base width. (Watch out for integer division). 402444.1701098.qx3zqy7 1 import java.util.Scanner; 2 1 test passed 3 public class CalcPyramid Volume { 4 5 6 7 public static double pyramidVolume (double baseLength, double baseWidth, double pyramidHeight) { double pyramidVolume = ((baseLength * baseWidth) * pyramid Height) / 3; return pyramidVolume; All tests passed 8 9 10 11 public static void main (String[] args) { Scanner scnr new Scanner(System.in); double userLength; 12 double userWidth; 13 double userHeight; 14 15 16 userLength = scnr.nextDouble(); userWidth = scnr.nextDouble(); 17 userHeight scnr.nextDouble(); 81F Mostly cl... ^ )) 6:55 PM
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started