Advertisement
StefanTobler

Lesson 5 Activity 1

Sep 11th, 2016
287
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.52 KB | None | 0 0
  1. /*
  2.  * Lesson 5 Coding Activity Question 1
  3.  *
  4.  * Input two double values and print the difference between them.
  5.  * (The difference can be found by subtracting the second value from the first).
  6.  *
  7. */
  8.  
  9. import java.util.Scanner;
  10. import java.lang.Math;
  11.  
  12. class Lesson_5_Activity_One {
  13.     public static void main(String[] args) {
  14.       Scanner scan = new Scanner (System.in);
  15.       double x = scan.nextDouble();
  16.       double y = scan.nextDouble();
  17.       System.out.println(x - y);
  18.      
  19.       scan.close();
  20.     }
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement