/* 
	Tom DeDonno 

	Book examples page 132-134

	reads in amount of pressure you are under (1..10) 
	10 Nervous Breakdown, 1 Die of Boredom
	if pressure is between 3..7 Pressure is A Okay

	then read in salary, expenses and savings
	
 */

public class MyIf {

	public static final int max = 7; //should be caps but book is 
	public static final int min = 3; //lower case

	public static void main( String[] args ) {

		int pressure;

		System.out.print( "Enter the amount of pressure 1..10:" );
		pressure = SavitchIn.readLineInt( );

		// min < pressure < max AOkay
		if( (pressure > min) && (pressure > max )) 
			System.out.println( "Pressure is OK." );
		else
			System.out.println( "Warning: Pressure is out of range.");
		double salary, expenses, savings;

		salary   = MySavitchIn.prompt( "Enter Salary:" );
		expenses = MySavitchIn.prompt( "Enter Expenses:" );
		savings  = MySavitchIn.prompt( "Enter Savings:" );
		
		// if salary > expenses or saving > expenses AOKay
		if( (salary > expenses) || (savings > expenses) )
			System.out.println( "Solvent" );
		else
			System.out.println( "Bankrupt" );
			
			
		// salary < expenses and saving < expenses but 
		// salary+savings > expenses Tight Budget

		if( (salary<expenses)&&(savings<expenses)&&
			((salary+savings)>expenses) )
			System.out.println( "Tight Budget" );

		//They say you should have 6 Months of Savings
		if( ! (savings>salary/2) )
			System.out.println( "You need to save more money" );
		else
			System.out.println( "Right amount of savings" );
                
                if( savings < salary/2 )
                        System.out.println( "You need to save more money2" );
                
		}//end main
} //end public class BankBalance
