Skip to content

Instantly share code, notes, and snippets.

@adenhaus
Created January 12, 2021 15:39
Show Gist options
  • Save adenhaus/5f149498ea5e5e6b7348681cb4d012f5 to your computer and use it in GitHub Desktop.
Save adenhaus/5f149498ea5e5e6b7348681cb4d012f5 to your computer and use it in GitHub Desktop.
public class DuplicationRemoved {
String buildingType;
int HOUSE_NUM = 5;
int SHORT_NUM = 10;
int TALL_NUM = 20;
int V_TALL_NUM = 40;
public static void classifyBuilding(int floors) {
if (floors < HOUSE_NUM) {
buildingType = "house";
} else if (floors < SHORT_NUM) {
buildingType = "short";
} else if (floors < TALL_NUM) {
buildingType = "tall";
} else if (floors < V_TALL_NUM) {
buildingType = "very tall";
} else {
buildingType = "skyscraper";
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment