/*
 *
 * DinnerBill1

   write a program that reads in amount of dinner bill and number
   of business associated who attended dinner,
  
   take into account state tax and 15% tip
  
   associates don't carry any coins, so bill should compute
   whole dollar amounts each associate must pay
  
   
 */

import java.io.*; // For System.out

public class DinnerBill1 {
  
  final double taxRate = 0.075;
  final double tip     = 0.150;
  double bill = 0.0;
  int associates = 1;
  boolean waitress = true; // Set for false bad waitress
    
  void read(  ) {

	System.out.print( "Enter Amount of Bill ->" );
	bill = SavitchIn.readDouble();
        
	System.out.print( "Enter Number of Associates -> " );
	associates = SavitchIn.readInt();
  }

  private void print( ) {

        bill = (bill - bill*taxRate)*tip + bill;
        int eachPays = (int)(bill/associates);
        
	System.out.println( );
	System.out.println( "Our Dinner Bill with tip is  " + bill + " Each Associate Must Pay " +
	                     eachPays );
        
        
        if( waitress ) 
            System.out.println( "Waitress was cute so jerk will pay " + (int)(eachPays+1) );
        else
            System.out.println( "Tough Luck waitress you don't get a full tip" );
	}

  public void allDone( ) {
    System.out.println( "Press anything on key board to Quit Program" );
    SavitchIn.readLine( );
  }
  
  public static void main( String[] args ) {
	
	DinnerBill db = new DinnerBill( );
	db.read( );
	db.print( );
	db.allDone( );
        }
}

