
/*

inputs number of donuts, and glasses of milk
program, prints out number of donuts,
glasses of milk and donuts per glass,

Program warns if no milk is available

 */

public class GotMilk1 {

	private int donutCount, milkCount;

	private double donutsPerGlass( ) {
		return( (double)donutCount/(double)milkCount ); 
		}

	private int prompt( String comment ) {

		System.out.println( comment );
		return( SavitchIn.readLineInt() );
		}
	private void print( ) {

		if( milkCount < 1 ) {

			System.out.println( "No Milk! " );
			System.out.println( "Go Buy some milk" );
		} else {
			System.out.println( donutCount + " donuts " +
			"and " + milkCount + " glasses of milk." );
			System.out.println( "You have " + donutsPerGlass() +
			" donuts for each glass of milk." );
			}
		} // End of void print( )

	public static void main( String[] args ) {

		GotMilk1 milk = new GotMilk1( );
		milk.donutCount = milk.prompt( "How many donuts do we have? ");
		milk.milkCount  = milk.prompt( "How many glasses of milk? " );
		milk.print( );
		}
}
		
		

