Advertisement
StefanTobler

Lesson 6 Activity 3

Sep 11th, 2016
133
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.50 KB | None | 0 0
  1. /*
  2.  * Lesson 6 - Unit 1 - Output in Java
  3.  */
  4.  
  5. import java.io.*;
  6. import static java.lang.System.*;
  7.  
  8. import java.util.Scanner;
  9.  
  10. class Lesson_6_Activity_Three{
  11.  
  12.  
  13.      public static void main (String str[]) throws IOException {
  14.        Scanner scan = new Scanner (System.in);
  15.          
  16.        System.out.println("Please input a decimal number:");
  17.        double x = scan.nextDouble();
  18.        System.out.println("Answer: " + ((int)((x - (int)x)*100)));
  19.          
  20.        scan.close();
  21.      }
  22.  
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement