Age/Gender: 20, Male
Location: Danville, VA
Job: school
umm..might update this.. when i get good
Newgrounds Stats
Whistle Status: Normal
Exp. Points: 558 / 710
Exp. Rank #: 68,281
Voting Pow.: 4.99 votes
BBS Posts: 276 (0.08 per day)
Flash Reviews: 43
Music Reviews: 0
Trophies: 0
Stickers: 0
hello, just testing this for the future, when I actually make games
--------------------------------------
--------------------------------------
------------------------------------
import javax.swing.*;
public class Lab5 {
public static String isOrIsNot, inputWord;
public static String [] wordArray;
public static void main(String[] args) {
wordArray = new String[10];
TextFileInput source = new TextFileInput(args[0]);
int i=0;
while (i<10)
{
wordArray[i] = source.readLine();
i++;
}
while(true)
{
inputWord = JOptionPane.showInputDialog(null,"Ente r a word in all lower case:");
if (inputWord.equals("STOP"))
break;
if (wordIsThere(inputWord,wordArray))
isOrIsNot = "is";
else
isOrIsNot = "is not";
JOptionPane.showMessageDialog(null,"Th e word "+inputWord+" "+
isOrIsNot+" on the list.");
}//while stops here
} //main
public static boolean wordIsThere(String findMe, String[] theList){
int i=0;
if (findMe.equals("STOP"))
System.exit(0);
while (i<7){
if (findMe.equals(theList[i]))
return true;
i++;
}
return false;
}
}
--------------------------------------
--------------------------------------
------------------------------------
import javax.swing.*;
public class Lab4 {
public static String[] wordArray =
{"hello","goodbye","cat","dog","red","
green","sun","moon"};
public static String isOrIsNot, inputWord;
public static void main(String[] args) {
while (true){
inputWord = JOptionPane.showInputDialog(null,"Ente r a word in all lower case:");
if (wordIsThere(inputWord,wordArray))
isOrIsNot = "is";
else
isOrIsNot = "is not";
JOptionPane.showMessageDialog(null,"Th e word "+inputWord+" "+
isOrIsNot+" on the list.");
}//while stops here
} //main
public static boolean wordIsThere(String findMe, String[] theList){
int i=0;
if (findMe.equals("STOP"))
System.exit(0);
while (i<0){
if (findMe.equals(theList[i]))
return true;
i++;
}
return false;
}
}
--------------------------------------
--------------------------------------
------------------------------------