Advertisement
MrDoyle

Asking Questions

Aug 22nd, 2020
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.83 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class Main {
  4.  
  5.     public static void main(String[] args) {
  6.  
  7.         Scanner input = new Scanner(System.in);
  8.  
  9.         int age;
  10.         int heightMeters;
  11.         int heightCm;
  12.         double weight;
  13.  
  14.         System.out.println();
  15.         System.out.print("How old are you? ");
  16.         age = input.nextInt();
  17.  
  18.         System.out.print("How many meters tall are you? ");
  19.         heightMeters = input.nextInt();
  20.  
  21.         System.out.print("And how many centimeters? ");
  22.         heightCm = input.nextInt();
  23.  
  24.         System.out.print("How much do you weigh in kilograms? ");
  25.         weight = input.nextInt();
  26.  
  27.         System.out.println();
  28.         System.out.println("So you are " + age + " years old, " + heightMeters + "." + heightCm + "m tall, and weigh " + weight + "kgs.");
  29.  
  30.  
  31.  
  32.     }
  33. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement