22 Apr 2013
Today moved to a lab and review day. The test will be Wednesday 24, 2013. public class example { public static void main(String[] args) //do if(intYear % 4 == 0 && intYear % 100 != 0) //System.out.println(intYear + " is a leap year " + boolLeapYear); //----------------------------------------------- for(char charCounter = 'A'; charCounter <= 'Z'; charCounter++) System.out.println(aryCharacters); //System.out.println(aryLetters); //----------------------------------------------- ArrayList aryValidPassword = new ArrayList(); for(int intIndex = 0; intIndex < aryValidPassword.size(); intIndex++) //System.out.println(strPassword + " is valid " + boolValidPassword); }
import java.util.ArrayList;</p>
{
int intYear = 2100;
boolean boolLeapYear = false;
//scanner input
//while (<1582)
{
boolLeapYear = true;
}
else if(intYear % 400 == 0)
{
boolLeapYear = true;
}
ArrayList aryCharacters = new ArrayList();
ArrayList aryLetters = new ArrayList();
String strParse = "Hello World";
{
aryCharacters.add(new Character(charCounter));
aryLetters.add(charCounter - 'A',0);
}
//System.err.println(aryLetters.size());
for(int intCharPosition = 0; intCharPosition < strParse.length(); intCharPosition++) { int intLocation = strParse.toUpperCase().charAt(intCharPosition); if(intLocation >= 'A' && intLocation <= 'Z')
{
//System.err.println(aryLetters.size() + ", " + intLocation + "=" + strParse.toUpperCase().charAt(intCharPosition));
//System.out.println(intLocation);
//Go to that location in the array store that stores number there.
Integer intNumber = aryLetters.get(intLocation - 'A');
//Add to the number there.
intNumber++;
//Store the number back in the right location.
aryLetters.set(intLocation - 'A',intNumber);
}
System.out.println(aryLetters);
}
//System.err.println(aryLetters.size());
String strPassword = "access";
aryValidPassword.add("HelloWorld");
aryValidPassword.add("access");
boolean boolValidPassword = false;
{
if(strPassword == aryValidPassword.get(intIndex))
{
boolValidPassword = true;
}
}
}</code>
{"display_name"=>"chris", "login"=>"chris", "email"=>"crmacd@gmail.com", "url"=>"http://www.crmacd.com"}