Shavit

P. 70 Ex. 4.2

Oct 5th, 2013
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.55 KB | None | 0 0
  1. // Shavit Borisov
  2. // HW
  3.  
  4. import java.util.Scanner;
  5.  
  6. public class StudentHeight {
  7.  
  8.     public static void main(String[] args)
  9.    
  10.     {
  11.        
  12.         Scanner in = new Scanner (System.in);
  13.        
  14.         float StudentOne, StudentTwo;
  15.        
  16.         System.out.println("Enter the height of the first student: ");
  17.             StudentOne = in.nextFloat();
  18.         System.out.println("Ener the height of the second student: ");
  19.             StudentTwo = in.nextFloat();
  20.        
  21.         System.out.println("The height difference between the students is" + Math.abs(StudentOne - StudentTwo));
  22.        
  23.         in.close();
  24.     }
  25.  
  26. }
Advertisement
Add Comment
Please, Sign In to add comment