Answer:
The method in C++ is as follows:
double calcPyramidVolume(double baseLength, double baseWidth, double pyramidHeight){
double baseArea = calcBaseArea(baseLength, baseWidth);
double volume = baseArea * pyramidHeight;
return volume;
}
Explanation:
This defines the calcPyramidVolume method
double calcPyramidVolume(double baseLength, double baseWidth, double pyramidHeight){
This calls the calcBaseArea method to calculate the base area of the pyramid
double baseArea = calcBaseArea(baseLength, baseWidth);
This calculates the volume
double volume = baseArea * pyramidHeight;
This returns the volume
return volume;
}
<em>See attachment for complete program that include all methods that is required for the program to function.</em>
Sorry I don’t know the answer I am really sorry
COMPLETE QUESTION
I. public class Test {
public static void main(String[] args){
System.out.println("Welcome to Java!");
}
}
II. public class Test { public static void main(String[] args) {System.out.println("Welcome to Java!");}}
Answer:
Both codes will compile and run and display Welcome to Java, but the code in II has a better style than I
Explanation:
When written codes, paying attention to proper coding styles and efficient memory management enables us to create programs that are highly efficient, coding styles refer to proper indentions and avoiding too lenghty lines of code (as is in code I), adding approprite comments etc.