Java program that displays the dimensions of a letter­size (8.5 × 11 inch) sheet of paper in millimeters
Posted by Samath
Last Updated: February 08, 2021

Write a Java program that displays the dimensions of a letter­size (8.5 × 11 inch) sheet of paper in millimeters. There are 25.4 millimeters per inch. Use con stants and comments in your program.

public class Main
{
    public static void main(String[] args) {
        
	    final double MILIMETERS_INCH = 25.4;
	    final double width = 8.5;
	    final double height = 11;
	    double milimeters_width;
	    double milimeters_height;
	
	    milimeters_width = width * MILIMETERS_INCH;
	    milimeters_height = height * MILIMETERS_INCH;
		
		System.out.printf("Dimensions in milimeters: %.2f, %.2f", milimeters_width, milimeters_height);
	}
}