Question: 1- Using 2D array 2- Reading and writing to a text file in Java Write a java program that solves the following problem using 2-dimensional

1- Using 2D array 2- Reading and writing to a text file in Java

Write a java program that solves the following problem using 2-dimensional arrays and I/O to a text file: Suppose we have a bunch of triangles prism and we would like to find the volume of each one: Create two 2D arrays [2][2] that store the base (double) and height (double) Read the base (b) and the height (h) from the user then store them in the

arrays Use 3 as altitude (a) for the triangle prism. Calculate the volume of the triangle prism using this formula: AV= 0.5bha Store the volume in another 2D array (double) Write the base, height and volume in a text file (triangles_prism.txt) Submit your code and your text file

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!