StefanTobler

Lesson 5 Activity 4

Sep 11th, 2016
130
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.55 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_Four {
  13.     public static void main(String[] args) {
  14.       Scanner scan = new Scanner (System.in);
  15.       System.out.println("Enter a price:");
  16.       double x = scan.nextDouble();
  17.       System.out.println("Change from $20: $" +(20-x));
  18.  
  19.      
  20.       scan.close();
  21.     }
  22. }
Add Comment
Please, Sign In to add comment