AUTHOR

homework done bye (check out my sloppy java)



import java.util.Scanner;
public class questioniii {
public static void main (String[] args) {


String name;
char x;
int i;

for ( i=1; i<=4; i++ ) {


System.out.println("Please enter a first name");

Scanner keyboard = new Scanner(System.in);
name = keyboard.nextLine();



if (name.equals("Stop")){
System.out.println(i);
break;
}

x = name.charAt(0);

if (x=='E') {
System.out.println("This name starts with E");
} else {
System.out.println("This name does not start with E");
}
}
}
}

-This message has been edited by ARegular on 12/17/2010 1:15:12 AM

u suck. bye ^_^
Want to come over and listen to shitty punk rock and watch a movie or smash the state or something?
wrap that shit with [ code >
FriendZone quote:
wrap that shit with [ code >
I have no idea what that means, I'm in Intro to Java.
ARegular quote:
I have no idea what that means, I'm in Intro to Java.
he means your forum post

Wrap it in <code></code> blocks

(but well, with square brackets, i.e.)





nevermind FtJ's buggy bbcode implementation

import java.util.Scanner;
public class questioniii {
public static void main (String[> args) {


String name;
char x;
int i;

for ( i=1; i<=4; i++ ) {


System.out.println("Please enter a first name";

Scanner keyboard = new Scanner(System.in);
name = keyboard.nextLine();



if (name.equals("Stop"){
System.out.println(i);
break;

}

x = name.charAt(0);

if (x=='E') {
System.out.println("This name starts with E");

} else {
System.out.println("This name does not start with E");

}
}
}
}
and now replace the smiley_wink.gif
FriendZone quote:


x = name.charAt(0);

if (x=='E') {
System.out.println("This name starts with E");

} else {
System.out.println("This name does not start with E");

}
}
}
}
well, that's not going to run
Hercules quote:
nevermind FtJ's buggy bbcode implementation
Hercules quote:
else {
System.out.println("This name does not start with E");

}
}
}
}
well, that's not going to run
It does
Hercules quote:
else {
System.out.println("This name does not start with E");

}
}
}
}
well, that's not going to run
it's horribly hard to 'format' code in FTJ

I wish they had an auto formatter like SMF
man, what a hideous way to get user input and do string comparisons
glad i dont have to bother with java
ARegular quote:

}
}
}
well, that's not going to run
It does
Klint's rendition is missing parenthesis and whatnot

Quick reply

Sign in to post a message.
Smileys

Times shown in Eastern Time (ET).