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
Post a Comment