
/**
 * Write a description of class PlayWithIf here.
 * 
 * @author (your name) 
 * @version (a version number or a date)
 */
public class PlayWithIf
{
	

	public static void ifNegative_1(int i) {
	    if (i < 0) System.out.println("The value " + i + " is negative");
	   }
	   
	public static void ifNegative_2(int i) {
	    if (i < 0) System.out.println("The value " + i + " is negative");
	    else System.out.println("The value " + i + " is positive");
	   }
	      
	      
	public static void day(int x) {
	       String the_day;
	       switch (x) {
	           case 1: the_day = "Monday"; break;
	           case 2: the_day = "Tuesday"; break;
	           case 3: the_day = "Wednesday"; break;
	           case 4: the_day = "Thursday"; break;
	           case 5: the_day = "Friday"; break;
	           case 6: the_day = "Saturday"; break;
	           case 7: the_day = "Sunday"; break;
	           default: the_day = "This is not an accepted value";    
	       }
          System.out.println(the_day);
	   }
	   
	   
	 public static void  day_new(int x) {
	       String the_day;
	       
	       if (x == 1) the_day = "Monday";
	       else {
	           if (x == 2) the_day = "Tuesday";
	           else {
	               if (x == 3) the_day = "Wednesday"; 
	               else {
	                   if (x == 3) the_day = "Wednesday"; 
	               else {
	                   if (x == 4) the_day = "Thursday";
	               else {
	                   if (x == 5) the_day = "Friday";  
	               else {
	                   if (x == 6) the_day = "Saturday"; 
	               else {
	                   if (x == 7) the_day = "Sunday"; 
	               else the_day = "This is not an accepted value";
	           }}}}}}}
	       System.out.println(the_day);
	   }  
	         
	      
	public static void orderInt(int x, int y, int z) {
	    int first = 0; 
	    int second = 0;
	    int third = 0;
	    
	    if ((x < y) && (x < z)) {
	        first = x;
	        if (y < z) {
	            second = y; third = z;
	        } else {second = z; third = y;}
	       }
	       
	    if ((y < x) && (y < z)) {
	        first = y;
	        if (x < z) {
	            second = x; third = z;
	        } else {second = z; third = x;}
	       }
	       
	    if ((z < y) && (z < x)) {
	        first = z;
	        if (y < x) {
	            second = y; third = x;
	        } else {second = x; third = y;}
	       }
	       
	    
	   System.out.println("Numbers in order are: "  + first + " " + second + " " + third);
}
	   
	   public static void orderInt2(int x, int y, int z) {
	    int first, second, third;
	   
	    if (x < y) {
	        if (y < z) {
	            first = x; second = y; third = z;
	           }
	        else {// x<y and z<=y
	            third = y;
	            if (x < z) {// x < z < y
	                first = x; second = z;
	               }
	            else {// z <= x < y
	                first = z; second = x;
	               }
	           }
	       }
	    else { // y <= x
	        if (z < y) { //z < y <= x
	            first = z; second = y; third = x;
	           }
	        else {// y <= x and y <= z
	            first = y;
	            if (x < z) {// y <= x < z
	                second = x; third=z;
	               }
	            else {// y <= z <= x
	                second = z; third = x;
	               }
	           }
	       }
	       System.out.println("Numbers in order are: "  + first + " " + second + " " + third);
	   }
	   
	   
	   public static void main(String[] args){
	       ifNegative_1(-5);
	       ifNegative_1(5);
	       
	       ifNegative_2(-3);
	       ifNegative_2(4);
	       
	       day(3); day(9);
	       day_new(4); day_new(-1);
	       
	       orderInt(3, 2, 9);
	       orderInt(1, 4, 3);
	       
	       orderInt2(3, 2, 9);
	       orderInt2(1, 4, 3);
	       
	   }
	  
	   
	   
	   
	   
	   
	   
}

