

Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Material Type: Exam; Class: ALGORITHMIC DESIGN I; Subject: Computer Science & Engineering; University: University of South Carolina - Columbia; Term: Unknown 1989;
Typology: Exams
1 / 3
This page cannot be seen from the preview
Don't miss anything!


Robin Starfire BeastBoy [2] 40 36 32 28 24 To infinity 10 11 12 11 12 12 and beyond! [3] 1-Penn 2-Penn 3-Teller 4-10000. 5-9000. 6-10000. 7-10000. 8-400. [4]
public interface ISimpleNumber { public boolean isEven(); public int multiplyByTwo(); } public class SimpleNumber implements ISimpleNumber { private int value; public SimpleNumber( int v){ this .value = v; } public boolean isEven() { return this .value % 2 == 0; } public int multiplyByTwo() { this .value *= 2; return this .value; } } [6] public static String fullStateName(String abbrev){ int abbrevIndex, beginIndex, endIndex; String abbrevPlsFirst, nextAbbrev, nextAbbrevPlsFirst; abbrevIndex = acro.indexOf(abbrev); String subAcro = acro; while (abbrevIndex % 2 != 0){ subAcro = subAcro.substring(abbrevIndex + 1); abbrevIndex += subAcro.indexOf(abbrev) + 1; } abbrevPlsFirst = abbrev + abbrev.charAt(0); beginIndex = acroStates.indexOf(abbrevPlsFirst) + 2; if (abbrevIndex < acro.length() - 2){ nextAbbrev = acro.substring(abbrevIndex + 2, abbrevIndex + 4); nextAbbrevPlsFirst = nextAbbrev + nextAbbrev.charAt(0); endIndex = acroStates.indexOf(nextAbbrevPlsFirst); return acroStates.substring(beginIndex, endIndex); } else { return acroStates.substring(beginIndex); } }