From guna@andrew.cmu.edu Sat Nov 10 09:53:51 2001 Date: Sat, 10 Nov 2001 09:52:57 -0500 (EST) From: Ananda D Gunawardena To: +dist+~guna/public/15100H.dl@andrew.cmu.edu, 15-100 I <+dist+~guna/public/15100I.dl@andrew.cmu.edu> Cc: Ananda D Gunawardena Subject: lab7 Dear Students, The following may be helpful in doing the lab. 1. How to convert an int to Integer and store in the vector V int x; Integer myint = new Integer(x); V.add(myint); 2. How to extract int value from an Integer object int x = ((Integer)V.elementAt(i)).intValue(); 3. How to print a number with two decimal places import java.text.*; DecimalFormat precision = new DecimalFormat( "0.00" ); System.out.println(precision.format(reference to the number)); Hope this helps. let me know if you have other questions. ananda