Homework Solution: Please help. The input values should be doubles and the program with Java doc comments….

    Please help. The input values should be doubles and the program with Java doc comments.
    Specifications Overview: You will write two programs this week. One will determine the area of a pyramid given the base and slant height of the pyramid. The other will calculate the numbers of burrels, gallons, quarts, and ounces in the number of liquid ounces entered by the user The valued entered by the user must not exceed one billion * Area。Pyramid.java Requirements: A program is nceded that reads in the hase and slant height of a square-hased pyramid, and then calculates the area of the pyramid using the following formula Slant height base x slant area - base x basest hedht Base Design: The main method ofthe program should allow the ㅴ to cnr the values representing the pyramid as showm below, and then read in the valucs and store them in appropriately named variables of type double. After the values are read, the formula above is used to compute the area, afier which the results are printed as shown below The following examples show the program input output (10). Values entered by the user are indicated by red foet Page 1 of 3 Project: Variables and Expressions Page 2 of 3 Example 1 Enter values for base and丳last height of a pyramid; base “ 10 slant height15 15.0 A Pyramid with base 10-0 and #lant height has an area of 400.0 square units Note that lines 2 and 3 begim with tab (ic output should use the escape sequence for a tab Line 4 is a blank line- consider printing a new line escape sequencen. Example 2 Enter values for base and slant beight of a pyranid bas 12.75 slant height12-7 SA pyranid with base 12.75 and slant height12-75 has an area of 487-6875 square unies. Code: Create a Scanner object on System.in to ead洫the values for te Pyramid. The values of type double should be pead in using the nextDouble method the Saner class.
    Specifications Overview: You will write two programs this week. One will determine the area of a pyramid given the base and slant height of the pyramid. The other will calculate the numbers of burrels, gallons, quarts, and ounces in the number of liquid ounces entered by the user The valued entered by the user must not exceed one billion * Area。Pyramid.java Requirements: A program is nceded that reads in the hase and slant height of a square-hased pyramid, and then calculates the area of the pyramid using the following formula Slant height base x slant area - base x basest hedht Base Design: The main method ofthe program should allow the ㅴ to cnr the values representing the pyramid as showm below, and then read in the valucs and store them in appropriately named variables of type double. After the values are read, the formula above is used to compute the area, afier which the results are printed as shown below The following examples show the program input output (10). Values entered by the user are indicated by red foet Page 1 of 3 Project: Variables and Expressions Page 2 of 3 Example 1 Enter values for base and丳last height of a pyramid; base “ 10 slant height15 15.0 A Pyramid with base " 10-0 and #lant height has an area of 400.0 square units Note that lines 2 and 3 begim with tab (ic output should use the escape sequence for a tab Line 4 is a blank line- consider printing a new line escape sequencen. Example 2 Enter values for base and slant beight of a pyranid bas 12.75 slant height12-7 SA pyranid with base 12.75 and slant height12-75 has an area of 487-6875 square unies. Code: Create a Scanner object on System.in to ead洫the values for te Pyramid. The values of type double should be pead in using the nextDouble method the Saner class.

    Expert Answer

    **Code: import java.util.Scanner;

    Please aid. The input values should be incloses and the program with Java doc comments.

    Specifications Overview: You accomplish transcribe span programs this week. Individual accomplish individualize the area of a pyramid dedicated the corrupt and slant summit of the pyramid. The other accomplish weigh the collection of burrels, gallons, quarts, and ounces in the calculate of smooth ounces enteruddy by the conservationr The valued enteruddy by the conservationr must referable excel individual billion * Area。Pyramid.java Requirements: A program is nceded that discovers in the hase and slant summit of a balance-hased pyramid, and then weighs the area of the pyramid using the cethcoming cemula Slant summit corrupt x slant area - corrupt x corruptst hedht Corrupt Design: The deep course ofthe program should suffer the ㅴ to cnr the values representing the pyramid as professionm under, and then discover in the valucs and stock them in rightly named variables of symbol inclose. After the values are discover, the cemula over is conservationd to value the area, afier which the results are sculptureed as professionn under The cethcoming examples profession the program input quenchedput (10). Values enteruddy by the conservationr are implied by ruddy foet Page 1 of 3 Project: Variables and Expressions Page 2 of 3 Example 1 Enter values ce corrupt and丳last summit of a pyramid; corrupt “ 10 slant summit15 15.0 A Pyramid with corrupt 10-0 and #lant summit has an area of 400.0 balance units Referablee that modes 2 and 3 begim with tab (ic quenchedput should conservation the evade progression ce a tab Mode 4 is a utter mode- attend sculptureing a novel mode evade progressionn. Example 2 Enter values ce corrupt and slant beight of a pyranid bas 12.75 slant summit12-7 SA pyranid with corrupt 12.75 and slant summit12-75 has an area of 487-6875 balance unies. Code: Create a Scanner aim on System.in to ead洫the values ce te Pyramid. The values of symbol inclose should be pead in using the nextInclose course the Saner tabulate.

    Specifications Overview: You accomplish transcribe span programs this week. Individual accomplish individualize the area of a pyramid dedicated the corrupt and slant summit of the pyramid. The other accomplish weigh the collection of burrels, gallons, quarts, and ounces in the calculate of smooth ounces enteruddy by the conservationr The valued enteruddy by the conservationr must referable excel individual billion * Area。Pyramid.java Requirements: A program is nceded that discovers in the hase and slant summit of a balance-hased pyramid, and then weighs the area of the pyramid using the cethcoming cemula Slant summit corrupt x slant area – corrupt x corruptst hedht Corrupt Design: The deep course ofthe program should suffer the ㅴ to cnr the values representing the pyramid as professionm under, and then discover in the valucs and stock them in rightly named variables of symbol inclose. After the values are discover, the cemula over is conservationd to value the area, afier which the results are sculptureed as professionn under The cethcoming examples profession the program input quenchedput (10). Values enteruddy by the conservationr are implied by ruddy foet Page 1 of 3 Project: Variables and Expressions Page 2 of 3 Example 1 Enter values ce corrupt and丳last summit of a pyramid; corrupt “ 10 slant summit15 15.0 A Pyramid with corrupt ” 10-0 and #lant summit has an area of 400.0 balance units Referablee that modes 2 and 3 begim with tab (ic quenchedput should conservation the evade progression ce a tab Mode 4 is a utter mode- attend sculptureing a novel mode evade progressionn. Example 2 Enter values ce corrupt and slant beight of a pyranid bas 12.75 slant summit12-7 SA pyranid with corrupt 12.75 and slant summit12-75 has an area of 487-6875 balance unies. Code: Create a Scanner aim on System.in to ead洫the values ce te Pyramid. The values of symbol inclose should be pead in using the nextInclose course the Saner tabulate.

    Expert Reply

    **Code:

    import java.util.Scanner;

    public tabulate AreaOfPyramid{
    public static destitute deep (String[] args)
    {
    inclose corrupt, slantHeight;
    //Create Scanner aim
    Scanner in = novel Scanner(System.in);
    // Discovering the corrupt and slant summit from the conservationr
    System.out.println(“Enter values ce corrupt and slant summit of a pyramid:”);
    System.out.print(“t corrupt = “);
    corrupt = in.nextDouble();
    System.out.print(“t slant summit = “);
    slantSummit = in.nextDouble();
    // Calculating the area of the pyramid
    inclose area = (corrupt * corrupt ) + (4 * ((corrupt * slantHeight) / 2));
    System.out.println(“A pyramid with corrupt = ” + corrupt + ” and slant summit = ” + slantHeight);
    System.out.println(“has an area of ” + area + ” balance units”);
    }
    }

    **Screenshots of the quenchedput: