Question
I need help with compiling a java program. I cant figure out why I am getting errors The program is below /************************************ *The java program
I need help with compiling a java program. I cant figure out why I am getting errors
The program is below
/************************************
*The java program that set two constant values*
*for nautical miles in kilometers and in miles.*
*Then assign a value to nautical miles and then*
*convert nautical miles in kilo meters and in miles*
*and print on console*
***************************************/
//NauticalMilesInteractive.java
import java.util.Scanner
public class NauticalMilesInteractive {
public static void main(String[] args) {
//Create an instance of Scanner class
Scanner scanner=new Scanner(System.in);
//Set a constant for 1km=1.852 nautical miles
final double TO_KM=1.852;
//Set a constant for 1mile=1.150779 nautical miles
final double TO_MILE=1.150779;
//Declare the nautical miles
double nauticalMiles;
System.out.printIn("Enter number of nautical miles :");
//Convert nautical miles to kms
System.out.printIn("In Kms = "+inKms);
//print nautical miles inMiles
System.out.printIn("In Miles= "+inMiles);
}
}//end of NauticalMiles
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started