Due: 9am, November 20, 2009.
No extensions -- if you are not finished then just hand in what you have completed.
The purpose of this assignment is to give you practice at writing Java code for:
Solve problems 18, 19, 21, 26, 27 and 28 in the Java Programming Exercises (Green Lecture Notes).
Points to note:
public double boxVolume( double height ) { ... public double boxSurfaceArea( double height ) { ....
will only work if you explicitly create a folded box object. We will cover that detail next week. In the meantime, you can compute the solution by avoiding objects and changing the method declarations to:
static double boxVolume( double height ) { ... static double boxSurfaceArea( double height ) { ....
Otherwise, the program structure for your solution should be very similar to the wind force computation ( see WindForce.java ) on the java examples page.
Finally, your program output should be formatted into a tidy table. Both the old style of formatting (i.e., using DecimalFormat objects) and c-style of formatting (i.e., using System.out.printf()) will be acceptable.
There is a small typo -- the mass matrix declaration should read:
double daMass [] = { 1.0, 1.0, ..... };
and not
double daMass [][] = { 1.0, 1.0, ..... };
Sorry about that!
The output for part b is rather long -- hence, just hand in an abbreviated version of your program output.
Part c can be done on pencil and paper and is only 5-6 lines long. However, in order to get the points you should clealy articulate your reasoning that leads to the result.
Note. For each problem, hand in a copy of your program source code and a script of I/O for typical program usage.
If you are working on UNIX/Mac OS X then the procedure for creating a script is easy -- just type something like:
prompt >> script output-file
Now all input/output on the screen will be echoed to the file "output-file". To terminate the script, type:
prompt >> exit
Now print "output-file" and hand it in.
If you are working on Windows, just cut-and-paste the output into a Word document.
Developed in November 2009 by Mark Austin
Copyright © 2009,
Department of Civil and Environmental Engineering, University of Maryland