Pretty much what im trying to accomplish, i need to write a program that figures out the distance between one point to another, using miles and feet..
Heres how it has to look: "The distance from my uncles house is ___ miles, or ____ feet."
I can get it to run if i add only whole miles..but when i try to add 8.5 miles, and compile, the program flips out..I know i need to use a double somewhere, but cant figure it out, here is my code..
import java.util.Scanner; //required for input
public class feetToMiles {
public static void main (String[] args){
//Create new scanner object called input
Scanner input = new Scanner (System.in); //allows for input
//Step1. Declare INPUT and Calculated Variables
int feet = 0, extraFeet = 0;
int miles = 0;
final int MILES_TO_FEET = 5280;
//Step2. Input any data
System.out.println("CO116 Mitch Taggart"); //required for CO116
System.out.print("Enter distance to uncle's house in miles >> ");
miles = input.nextInt();
//Step3. Calculate any data
feet = miles * MILES_TO_FEET;
//Step4. Display results
System.out.println("the distance to my uncles house is " + miles + " miles, or " + feet + " feet.");
}
}