SUBMIT REPORT User: aboutams Name: Mohamed S Aboutabl Course: cs139a Assignment: pt1 Version: 1 Date: Thu Sep 16 04:08:09 PM 2004 Files: RodConverter.java PDF-spec: 90/99 Honor Pledge: I have NOT received unauthorized assistance Compiling ... j139c RodConverter.java /aux/bin/progtst -C -v -f test-report pt1 *** PROGRAM TEST *** Assignment: pt1 Test Dir: /fs/home-f/aboutams/cs139.d/assign.d/pt1.d Test Cnt: 5 Test 01: (pt1 0<--- Test 01: correct output follows (WITH line numbers)---> 1 2 Rod Converter 3 4 Enter the number of rods to convert: 5 Number of rods: 0.00 6 7 Number of yards: 0.00 8 Number of miles: 0.00 9 10 Exiting program Rod Converter <--- Test 01: your incorrect output follows (WITH line numbers)---> 1 2 Rod Converter 3 4 Enter the number of rods to convert: 5 Number of rods: 0.0 6 7 Number of yards: 0.00 8 Number of miles: 0.00 9 10 Exiting program Rod Converter <--- First difference after line 5, char 19: Expected='0', Observed='\n'. ---> <--- Test 01: model err-output is empty ---> <--- Test 01: your err-output is empty ---> 2004-09-16 16:08 RodConverter.java Page 1 1 // ************************************************************* 2 // Name: Mohamed Aboutabl 3 // Date: 9/15/2004 4 // Assignment: Programming Assignment #1 RodConverter.java 5 // 6 // ************************************************************* 7 // References & Acknowledgements: I received no outside help 8 // 9 // ************************************************************* 10 // Name of the class: RodConverter 11 // Purpose of the class:Convert rods to yards and miles 12 // ************************************************************* 13 14 import cs1.Keyboard ; 15 import java.text.DecimalFormat ; 16 17 18 public class RodConverter 19 { 20 /**---------------------------------------------------------- 21 // Read in a distance in rods and display the equivalent 22 // yards and miles 23 // --------------------------------------------------------*/ 24 public static void main( String[] args) 25 { 26 // Variables Declarations 27 double rods, // number of rods to convert 28 yards , // equivalent yards 29 miles ; // equivalent miles 30 31 final double YARDS_PER_ROD = 5.5 , // Conversion constants 32 YARDS_PER_MILE = 1760.0 ; 33 34 DecimalFormat twoDecimals; 35 36 // Print the header 37 System.out.println("\n\t\t\tRod Converter\n"); 38 39 // Get the number of rods to convert then echo the values 40 System.out.print("Enter the number of rods to convert: "); 41 rods = Keyboard.readDouble() ; 42 System.out.println("\nNumber of rods:\t" + rods ); 43 44 // Convert to yards and miles 45 yards = rods * YARDS_PER_ROD ; 46 miles = yards / YARDS_PER_MILE ; 47 48 49 // Format and display the results on the screen 50 twoDecimals = new DecimalFormat("0.00") ; 51 52 System.out.println("\nNumber of yards:\t" + twoDecimals.format(yards) ); 53 System.out.println("Number of miles:\t" + twoDecimals.format(miles) ); 54 55 // Dsiplay the exit message 56 System.out.println("\n\t\tExiting program Rod Converter"); 57 58 } 59 }