0
write an application that reads a number in inches converts it to meters . note : 1 inch =0.0254meter sample output input value for inch:1000 1000.0 inch is 254 meter
pleas help):
11 Respostas
+ 5
Sorry , forgot to mention:- Dont forget to import scanner.Do this by writing this code in FIRST line:-
import java.util.Scanner;
+ 4
Anytime @Khulud Al-slman.
@Narender Yadav, I am from Punjab,India,Asia,Earth,Solar System
+ 4
Anytime @Khulud Al-slman
+ 3
Scanner sc=new Scanner(System.in);
double inches=sc.nextDouble();
double mtrs=inches*0.0254;
System.out.println(mtrs);
+ 3
Heres the complete code:-
import java.util.Scanner;
public class Program
{
public static void main(String[] args) {
Scanner sc=new Scanner(System.in);
double inches=sc.nextDouble();
double mtrs=inches*0.0254;
System.out.println(mtrs);
}
}
Also, 1000*0.0254=25.4 and not 254
+ 3
okay thank you bro😩💖
+ 2
@meharban_singh from where are you
+ 2
Why?
+ 1
ok thank you
+ 1
it is not the answer :(
+ 1
be come error