Monday, August 30, 2010
Computer Poem
class Poem {
public static void main(String[] args){
string result = “nothing”;
char prompt1, prompt2;
string color1, color2;
System.out.println(“Type Y for yes and N for no”);
System.out.println(“Are Rosaceae primarily #ff0000?”);
System.in.read(prompt1);
System.out.println(“Are Viola papilionacea primarily #BF5FFF?”);
System.in.read(prompt2);
if(prompt1 == y){
color1 = “#ff0000”;
}
if(prompt2 == y){
color2 = “#BF5FFF”;
}
else{
color1 =”nothing”;
color2 = “nothing”;
}
if(color1 == “#ff0000”) && if(color2 == “#BF5FFF”){
System.out.println("This unit recognizes itself as a personal computer.");
result = "love";
}
else{
result = "hate";
}
System.out.println("This computer terminal would like to expresses a sentiment of ") + result + (" towards
the individual known as its primary user.");
}
}
Wednesday, August 25, 2010
Subscribe to:
Posts (Atom)