Problem 07:
Write
a program that reads a number in feet, converts it
to
meters, and displays the result. One foot is 0.305 meter.
Description:
It is very
simple feet multiplied by 0.305
Solution
import java.util.*;
public class Message {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
float feet,meter;
System.out.println("Enter the distance
in feet");
feet=in.nextFloat();
meter=feet*0.305f;
System.out.println("The area of clyinder = "+meter);
}
}
Output
No comments:
Post a Comment