The program below is the answer to Liang’s Introduction to Java Programming (9th Edition) Chapter 2 Exercise 2.3.
1 2 |
/**<br /> *<br /> * @Author: Aghatise Osazuwa<br /> * Website: www.cscprogrammingtutorials.com<br /> *<br /> * Exercise 2.3 - Convert Feet To Meters<br /> *<br /> */ <br /><br />import java.util.Scanner;<br /><br />public class FeetToMeters {<br /> public static void main (String [] args) {<br /> Scanner input = new Scanner(System.in);<br /> System.out.println("This Program Converts A Number In Feet To Meters.n");<br /> System.out.println("Enter a value for feet: ");<br /> double feet = input.nextDouble();<br /> double meters = feet * 0.305;<br /> System.out.printf (feet + " feet is " + meters + " meters.n");<br /> }<br />} |
Click here to see other solutions to Introduction to Java Programming.