Programming Exercise 1
Simple Calculations
Write a program to calculate various properties for a rectangular solid. This is a 3 dimensional regular rectangular solid. (all angles are 90 degrees)
Your program shall calculate the total length of edges, surface area, and volume based on the width, length, and height of the rectangular solid.
Your program may ask a user to input the width, length, and height. Getting user input in Java is not the easiest thing in the world so you may use a piece of pre-existing Java code, ConsoleInput. Download the ConsoleInput source code and put it in the same directory as your program.
Click here to download ConsoleInput. Here is some example code for using ConsoleInput.
System.out.print("Enter the radius
of the circle: ");
double radius;
radius = ConsoleInput.readDouble();
// if you wanted to read an integer
System.out.print("Enter year: ");
int year;
year = ConsoleInput.readInt();
The program can be placed in the main method of a class.
public class Calcs
{
public static void main(String[] args)
{ // your code goes here
} // end of main
} // end of Calcs