Advertisement
nickjedl

SunSighting

Aug 24th, 2019
138
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.97 KB | None | 0 0
  1. package com.nickjedl.sunsighting;
  2.  
  3. /**
  4.  * @author nickjedl
  5.  */
  6. class SunSighting {
  7.  
  8.     public static void main(String[] args) {
  9.         String[] objects = {"zon", "zak", "zee", "kak"};
  10.         Method r = new Method();
  11.         String output;
  12.         for (String object: objects) {
  13.             for (int i = 0; i <= objects.length - 1; i++) {
  14.                 for (int j = objects.length - 1; j >= 0; j--) {
  15.                     System.out.println("Ik heb de " + object + " zien " + r.additive(objects[i]) + " in de " + objects[j]);
  16.                 }
  17.             }
  18.         }
  19.     }
  20.  
  21. }
  22.  
  23. class Method {
  24.     public String additive(String input) {
  25.         String original = input;
  26.         switch (input.substring(input.length() - 1)) {
  27.             case "n":
  28.                 return original + "nen";
  29.             case "k":
  30.                 return original + "ken";
  31.             case "e":
  32.                 return original + "ën";
  33.         }
  34.         return null;
  35.     }
  36. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement