Java Program Exercise code error -


so exercise asking write java class declares named constants represent number of kilometers (1.852) , number of miles (1.150779) in nautical mile. also, declare variable represent number of nautical miles , assign value it. compute , display, explanatory text, value of kilometers , in miles. assign value nautical miles variable, accept user input. output should user friendly.

this code have come far

import java.util.scanner;  public class nauticalmileskc {      public static void main(string[] args)      {          scanner getkm = new scanner(system.in);          double kilometer;          double nautical_mile;           system.out.print("kilometer distance enter: ");           kilometer = getkm.nextdouble();           nautical_mile = (kilometer * 540/1000);           system.out.println("nautical mile equivalent :");          system.out.println(nautical_mile);     }  } 

i keep getting error , not running

can me understand im doing wrong please i'm complete novice , first java class


Comments

Popular posts from this blog

resizing Telegram inline keyboard -

command line - How can a Python program background itself? -

php - "cURL error 28: Resolving timed out" on Wordpress on Azure App Service on Linux -