Mode Gelap

Recent in Fashion

Best Seller Books

1311110071 Input and Output Statement Height Units

Many people think about their height in feet and inches, even in some countries that primarily use the metric system. Write a program that reads a number of feet from the user, followed by a number of inches. Once these values are read, your program should compute and display the equivalent number of centimeters. Hint: One foot is 12 inches. One inch is 2.54 centimeters. 

Output:


5
7
Your height in centimeters is 170.18
6
1
Your height in centimeters is 185.42
6
9
Your height in centimeters is 205.74

Subscribe Our Newsletter

avatar
"By speaking behind my back, it means that you respect my existence enough not to act in front of my face."

Related Posts

1 Komentar

  1. import java.io.*;
    import java.util.Scanner;
    public class TestClass {
    public static void main(String[] args) {
    int f, i;
    double h;
    Scanner in = new Scanner(System.in);
    f = in .nextInt();
    i = in .nextInt();
    h = f * 12 * 2.54 + i * 2.54;
    System.out.println("Your height in centimeters is " + h);
    }
    }

    ReplyDelete

Article Top Ads

Parallax Ads

Article Center Ads

Article Bottom Ads