Created
November 2, 2012 01:13
-
-
Save ah052070/3998027 to your computer and use it in GitHub Desktop.
Simple string program in Java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Alexander Hunting | |
COP2258 | |
A1b | |
import java.util.Scanner; //imports utility that takes in or holds the name of user insect | |
public class BabyBumbleBee{ | |
public static void main(String[] args){ | |
System.out.println ("What is the name of your insect?"); | |
Scanner input = new Scanner(System.in); | |
String myInsect = input.nextLine(); | |
for(int counter=0; counter <5; counter = counter + 1){ | |
if(counter < 1){ | |
String a = "bringing home "; | |
String b = "Ouch!!! It Stung me!!! "; | |
System.out.println( "I'm " + a + "my baby " + myInsect); | |
System.out.println("Won't my mommy be so proud of me"); | |
System.out.println("I'm " + a + "my baby " + myInsect); | |
System.out.println(b); | |
}//end if | |
if(counter < 2){ | |
String a = "squishin' up"; | |
String b = "Ew!! What a mess!!"; | |
System.out.println("I'm " + a + "my baby " + myInsect ); | |
System.out.println("Won't my mommy be so proud of me"); | |
System.out.println("I'm " + a + "my baby " + myInsect); | |
System.out.println(b); | |
}// end if | |
if(counter < 3){ | |
String a = "licking up"; | |
String b = "Ick!! I feel sick!! "; | |
System.out.println("I'm " + a + "my baby " + myInsect); | |
System.out.println("Won't my mommy be so proud of me"); | |
System.out.println("I'm " + a + "my baby " + myInsect); | |
System.out.println(b); | |
}//end if | |
if(counter < 4){ | |
String a = "barfin' up"; | |
String b = "Oh!! What a mess!!"; | |
System.out.println("I'm " + a + "my baby " + myInsect); | |
System.out.println("Won't my mommy be so proud of me"); | |
System.out.println("I'm " + a + "my baby " + myInsect); | |
System.out.println(b); | |
}//end if | |
if(counter < 5){ | |
String a = "wipin up"; | |
String b = "Oops!! Mommy's new towel!!"; | |
System.out.println("I'm " + a + "my baby " + myInsect); | |
System.out.println("Won't my mommy be so proud of me"); | |
System.out.println("I'm " + a + "my baby " + myInsect); | |
System.out.println(b); | |
}// end if | |
if(counter == 5){ | |
String a = "wringin out"; | |
String b = "Bye Bye Baby"; | |
System.out.println("I'm" + a + "my baby" + myInsect); | |
}//end if | |
}//end for | |
}//end main | |
}//end class |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment