Visual Encyclopedia

Connor Goham

www.yourwebsite.com | CLICK TO UNLOCK!
www.yourwebsite.com |  50 IR to unlock
  | edit
this will contain any error messages
this will contain any error messages
Saving...
  25 IR to unlock
this will contain any error messages
Saving...
About you | CLICK TO UNLOCK!
About you |  5 IR to unlock

| edit

Posts

A warm and cozy fire by the Christmas tree

Posted in Christmas

The Leaning Tower of Pisa

Posted in Leaning Tower of Pisa

The Leaning Tower of Pisa

Posted in Leaning Tower of Pisa

The Leaning Tower of Pisa! My picture from my trip to Switzerland and Italy! Isn't is beautiful?

Posted in Leaning Tower of Pisa

This method has one parameter, it takes in an int and determines the appropriate suffix to add, it then returns said suffix as a string. It could be useful in a program where ordinal numbers are printed out. For example, in a print statement, after some int variable is printed, this method could be called right after with said variable in order to add the appropriate suffix (either -st, -nd, -rd, or -th). The code for this method follows below: public static String labelMaker(int n) //this method determines the appropriate ending to come after a number (-st, -nd, -rd, or -th) { String ending; //the end to be added to the number if ((n % 10 == 1) && (n != 11)) { ending = "st"; } else if ((n % 10 == 2) && (n != 12)) { ending = "nd"; } else if ((n % 10 == 3) && (n != 13)) { ending = "rd"; } else { ending = "th"; } return ending; }

Posted in Java (programming language)