Assignemnt #33 and WhatIf.java
Code
/// Name: James Hwang
/// Period: 6
/// Program Name: WhatIf
/// File Name: WhatIf.java
/// Date Finished: 9/29/2015
public class WhatIf{
public static void main(String[] args){
int people = 20, cats = 30, dogs = 15;
if ( people < cats){
System.out.println("Too many cats!!!!!!!!!!!!!!!!!!!!");
}
if ( people > cats){
System.out.println("No more cats!!!!!!!!!!!!!!!!!!!!!!!");
}
if ( people < dogs ){
System.out.println("The world is drooled on!!!!!!!!!!!!!");
}
if ( people > dogs){
System.out.println("The world is dry!!!!!!!!!!!!!!!!!!");
}
dogs += 5;
if ( people>= dogs)
{
System.out.println("MORE PEOPLE!!!!!!");
}
if ( people <= dogs){
System.out.println("MORE DOGS!!!!!!!!!!");
}
if ( people == dogs){
System.out.println("PEOPLE ARE DOGS!!!!!!!!!");
}
}
}
Picture of the output