Answered step by step
Verified Expert Solution
Link Copied!

Question

00
1 Approved Answer

CODING IN JAVA! I'm very confused! I will post my code I have in the comment box below the post.Thank you so much! You are

CODING IN JAVA!

I'm very confused! I will post my code I have in the comment box below the post.Thank you so much!

You are the project manager for a concrete company and you have been hired to fill a hole shaped as a triangular prism with concrete. Before you do, you need to line the hole with a sheet of plastic, so you need to know the measurements of the surface area, as well as the volume. The ratio of water to concrete is .5, so you need to know how many gallons of water will be used. You need to know the following formulas:

Surface Area of the triangular prism in inches

A= 2 * (height x base / 2) + length x width1 + length x width2 + length x base

Volume of a triangular prism in inches

V= (height x base x length) / 2

Gallons of water

G=Vin 231 * .5

Cost of plastic liner

$.36 per square inch (based on surface area)

Cost of concrete

$0.40 per cubic inch (based on volume)

Hours to work

1 hour per 30,000 cubic inches of volume

Cost of labor

$250 per hour

Input and Output:

Using these formulas as a basis, write a program that prompts and asks the user for the height and base, as well as the length, and two widths. You are to calculate the surface area of the space, as well as the volume and the number of gallons of water you will need. In writing your program, do the following:

  • Create constants for the following:

    • GALLONSCONVERSION: 231

    • LINERCOST: 0.36

    • CONCRETECOST: 0.40

    • HOURSHeighCALCULATOR: 30000

    • LABORCOST: 250.0

  • Prompt and accept height, base, length, width1, and width2.

  • Calculate the surface area of the prism.

  • Calculate the volume of the prism.

  • Determine how many gallons of water will be used.

  • Determine the total cost of the job

    • Cost of the liner + cost of the concrete + (hours of work * cost of labor)

  • Output the results.

Output values should all be labeled. Follow the sample run of the program given below for format. Numbers in bold are values entered by the user.

The program should work regardless of the measurement values entered.

Enter the height of the prism in inches : 45

Enter the base of the prism in inches: 65

Enter the length of the prism in inches: 62

Enter the width of side 1 of the prism: 72

Enter the width of side 2 of the prism: 78

The Surface Area is: 16255.0 square inches

The Volume is: 90675.0 cubic inches

The number of gallons of water needed is: 196.26623376623377

The total cost of the job:

Liner cost: $5851.8

Concrete cost: $36270.0

Labor cost: $755.625

__________________________________

Total project cost: $42877.425

Requirements

Complete the test data and test your program using the results from the test data. (Program 1 Test Data.docx)

Write your program in a class called PrismCalculator.java that has a main method. All values should be declared as double values.

Instructions, prompts, and answers should be in the form given above. Input should be entered by the user from the keyboard. Output should be displayed on the console.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions