// Leser inn antall av forskjellige kjøretøyer fra terminalen // og skriver ut en rapport public class AntallRapport1 { public static void main(String[] args) { // Les inn antall fra terminalen System.out.print("Antall biler: "); int antall_biler = Terminal.lesInt(); System.out.print("Antall båter: "); int antall_båter = Terminal.lesInt(); System.out.print("Antall tog: "); int antall_tog = Terminal.lesInt(); System.out.print("Antall mopeder: "); int antall_mopeder = Terminal.lesInt(); // Skriv ut rapport System.out.print(antall_biler); if (antall_biler == 1) { System.out.print(" bil, "); // entall } else { System.out.print(" biler, "); // flertall } System.out.print(antall_båter); if (antall_båter == 1) { System.out.print(" båt, "); // entall } else { System.out.print(" båter, "); // flertall } System.out.print(antall_tog); System.out.print(" tog og "); // entall og flertall System.out.print(antall_mopeder); if (antall_mopeder == 1) { System.out.println(" moped."); // entall } else { System.out.println(" mopeder."); // flertall } } }