Shavit

P. 96 Ex. 2

Oct 11th, 2013
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.57 KB | None | 0 0
  1. // Shavit Borisov
  2. // HW
  3.  
  4. import java.util.Scanner;
  5.  
  6. public class Taxi {
  7.  
  8.     public static void main(String[] args)
  9.    
  10.     {
  11.         Scanner in = new Scanner (System.in);
  12.        
  13.         System.out.println("Enter the number of people waiting for a taxi:");
  14.             int people = in.nextInt();
  15.        
  16.         System.out.println("Enter the number of seats in the taxi:");
  17.             int seats = in.nextInt();
  18.            
  19.         int fullTaxies = people/seats;
  20.         int leftOverPeople = people%seats;
  21.        
  22.         System.out.printf("%d taxies are full. %d people are left over.", fullTaxies, leftOverPeople);
  23.        
  24.         in.close();
  25.     }
  26.  
  27. }
Advertisement
Add Comment
Please, Sign In to add comment