There is what i have done so far and what i have to do.
Done so far:
public static void main(Sting args[]){
double miles
miles = scan.netDouble();
Scanner scan = new Scanner(System.in);
System.out.println("Enter number of miles: ");
float km = miles * 1.609f;
System.out.println(miles = "miles is " + km + "kimometers.");
}
And then what i have to do:Write a header file that contains the following two methods:
/* convert from miles to kilometres */ Public static double mileToKilometer(double mile) /* convert from kilometres to mile */ Public static double kilmeterToMile(double kilometre)The formula for the conversion is:
Mile = 1.609 * kilometre
Implement the header file and write a test program that invokes these methods display the following tables:
Miles KiloMeters KiloMeters Miles
1.0 0.6215 20.0 32.180
2.0 1.2430 25.0 40.225
.....
10.0 6.2150 65.0 104.58
Analysis:
Describe the problem including input and output in your own words.
Design:
Describe the major steps for solving the problem
Please HELP
This post has been edited by japanir: 28 February 2011 - 03:18 PM
Reason for edit:: Added code tags

New Topic/Question
This topic is locked




MultiQuote







|