public class chooseYourMedicine {
public static void main(String[] args) {
int strain = 4;
switch (strain) {
case 1: System.out.println("Gorilla Glue #4");
break;
case 2: System.out.println("Gello");
break;
case 3: System.out.println("Harlox");
break;
case 4: System.out.println("Tangerine Kush");
break;
case 5: System.out.println("Guava");
break;
case 6: System.out.println("Chocolate Hashberry");
break;
case 7: System.out.println("Brian Berry Cough");
break;
default: System.out.println("The is not one of our strains buddy");
}
}
// Output is tangerine kush
need coffee
Wednesday, June 29, 2016
Increment Pyramid Loop
public class InverseDecrementPyramidFromFive{
public static void main(String[]args){
for(int i=1;i<=5;i++){
for(int j=0; j<i; j++){
System.out.print("*");
}
System.out.println("");
}
for(int i=5;i>0;i--){
for(int j=0;j<i;j++){
System.out.println("*");
}
System.out.println("");
}
}
}
public static void main(String[]args){
for(int i=1;i<=5;i++){
for(int j=0; j<i; j++){
System.out.print("*");
}
System.out.println("");
}
for(int i=5;i>0;i--){
for(int j=0;j<i;j++){
System.out.println("*");
}
System.out.println("");
}
}
}
Tuesday, June 28, 2016
Control Flow Beverage Orderer
The above source code, represents control flow in Java. This is a script for a coffee ordering program.
Monday, June 27, 2016
Floyds Triangle
This Java file when compiled asks for how many rows the user would like to input into the floyd triangle. Then it creates the triangle. Floyds triangle is a common assignment in computer science classes. A floyd triangle is essentially a triangle made up of numbers continually incremented
Subscribe to:
Posts (Atom)




