Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Modern Database Management

Authors: Jeff Hoffer, Ramesh Venkataraman, Heikki Topi

12th edition

133544613, 978-0133544619

More Books

Students also viewed these Databases questions

Question

Compare and contrast families and family roles across cultures

Answered: 1 week ago

Question

What is Accounting?

Answered: 1 week ago

Question

Define organisation chart

Answered: 1 week ago

Question

What are the advantages of planning ?

Answered: 1 week ago

Question

Explain the factors that determine the degree of decentralisation

Answered: 1 week ago