Define a method pyramidVolume with double data type parameters baseLength, baseWidth, and pyramid Height, that returns...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Define a method pyramidVolume with double data type parameters baseLength, baseWidth, and pyramid Height, that returns as 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). Learn how our autograder works 484924.3417574.qx3zay7 3 public class CalcPyramidVolume { m & in 10 000 4 - 5 /* Your solution goes here */ 6 7 public static void main (String [] args) { Scanner scnr = new Scanner (System.in); double userLength; 8 9 10 11 12 13 14 15 16 17 18 19 } } double userWidth; double userHeight; userLength = scnr.nextDouble(); userWidth = scnr.nextDouble(); userHeight = scnr.nextDouble(); System.out.println("Volume: + pyramidVolume (userLength, userWidth, userHeight)); Define a method computeval() that takes one integer parameter and returns 7 times the parameter. Ex: If the input is 3, then the output is: 21 2 3 public class ValueComputation { mtin 4 5 /* Your code goes here */ 6 7 8 9 10 11 12 13 14 15 16 17 18} public static void main(String[] args) { Scanner scnr = new Scanner(System.in); int input; int result; input = scnr.nextInt (); || result computeval(input); } System.out.println(result); N Define a method pyramidVolume with double data type parameters baseLength, baseWidth, and pyramid Height, that returns as 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). Learn how our autograder works 484924.3417574.qx3zay7 3 public class CalcPyramidVolume { m & in 10 000 4 - 5 /* Your solution goes here */ 6 7 public static void main (String [] args) { Scanner scnr = new Scanner (System.in); double userLength; 8 9 10 11 12 13 14 15 16 17 18 19 } } double userWidth; double userHeight; userLength = scnr.nextDouble(); userWidth = scnr.nextDouble(); userHeight = scnr.nextDouble(); System.out.println("Volume: + pyramidVolume (userLength, userWidth, userHeight)); Define a method computeval() that takes one integer parameter and returns 7 times the parameter. Ex: If the input is 3, then the output is: 21 2 3 public class ValueComputation { mtin 4 5 /* Your code goes here */ 6 7 8 9 10 11 12 13 14 15 16 17 18} public static void main(String[] args) { Scanner scnr = new Scanner(System.in); int input; int result; input = scnr.nextInt (); || result computeval(input); } System.out.println(result); N
Expert Answer:
Answer rating: 100% (QA)
Here are two Java methods as per your instructions 1 pyramidVolume method to calculate the volume of ... View the full answer
Related Book For
Building Java Programs A Back To Basics Approach
ISBN: 9780135471944
5th Edition
Authors: Stuart Reges, Marty Stepp
Posted Date:
Students also viewed these programming questions
-
What is the difference between training and career development? Of these two concepts, which is more likely to increase retention in an organization? Why?
-
(10 points) Given that ry + xy = 1. 1. Find a solution of the differential equation that satisfies the initial condition y(1) = 10. Answer: y = 2. Find a solution of the differential equation that...
-
A researcher wanted to find out if there was difference between older movie goers and younger movie goers with respect to their estimates of a successful actors income. The researcher first...
-
A solid cubical block of side length 0.6 m is suspended from a spring balance. When the block is in water, the spring balance reads 80% of the reading when the block is in air. Determine the density...
-
Verify that the combined value of the constants appearing in Eq. 39-32 is 13.6 eV.
-
Draw a short section of the polymer obtained from anionic polymerization of β-propiolactone. CH3 CHj 3,3-dimethyloxacyclobutane
-
What is a new-venture team?
-
Nasoff Company operates a small manufacturing facility as a supplement to its regular service activities. At the beginning of 2011, an asset account for the company showed the following balances:...
-
10. A plastic ball is rising in water with terminal speed v. If we use a different plastic whose density is double that of the original ball but still less that density of water, keeping the radius...
-
Cambridge Accounting provides accounting services to its clients. After several significant server failures, the company is thinking of outsourcing all its data processing requirements to Seven Oaks...
-
Write a paper on Analysis of Clinical Pharmacist Interventions to Reduce Drug Related Problems at Hospital
-
The Communications Decency Act (CDA) a. was created in 1966. b. removes liability for ISPs as publishers. c. removes liability for ISPs as distributors. d. none of the above.
-
The four torts of invasion of privacy are ____________, ______________, _______________, and ____________.
-
True Or False A statement implying undisclosed facts may not be defamatory if it is an opinion.
-
Under what conditions does respondeat superior apply, and when does it not apply?
-
A public figure is/are a. one who has achieved fame. b. one who involuntarily inject themselves into a particular public controversy. c. those who wish to be famous. d. none of the above.
-
Given the following total revenue and total cost functions for afirm, maximize profit ? for the firm as follows (1) Set up the profit function ???? = ???????? ? ????????, (2)find the critical...
-
1. True or False. Pitfalls to consider in a statistical test include nonrandom samples, small sample size, and lack of causal links. 2. Because 25 percent of the students in my morning statistics...
-
Perform a Sort Detective challenge to run several sorting algorithms without knowing which is which. Try to figure out which sorting algorithm is which on the basis of the runtime and characteristics...
-
What is the output produced from the following statements? System.out.println("name\tage\theight"); System.out.println("Archie\t17\t5'9\""); System.out.println("Betty\t17\t5'6\"");...
-
What output is produced by the following program? public class MysteryReturn { 2. public static void main (String[] args) { 3 int x = 1, y = 2, z = 3; z = mystery (x, z, y); System.out.println (x + "...
-
First-Year College GPA Researchers at the College Board wanted to build a model that describes one's first-year college GPA. The researchers obtained the following model: \[\hat{y}=0.06 x_{1}+0.07...
-
Suppose we record the gender of the 15 students enrolled in an introductory statistics course as they enter the classroom. The males are denoted by a blue M and the females are denoted by a red...
-
A nutritionist wants to develop a model that describes the relation between the calories, total fat content, protein, sugar, and carbohydrates in cheeseburgers at fast-food restaurants. She obtains...
Study smarter with the SolutionInn App