Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class PPRechner {
- public static void main(String[] args) {
- @SuppressWarnings("resource")
- Scanner s = new Scanner(System.in);
- int menu, tage, faktor, wochen, hauptgebaeude, kaserne, stall, werkstatt, schmiede, adelshof, markt, holzfaeller, lehmgrube, eisenmine, bauernhof, speicher, wall, holz = 0, lehm = 0, eisen = 0;
- double pp = 0, pp1, pp2, pp3, pp4, pp5;
- System.out.println("Willkommen beim Die Staemme Premium Punkte Rechner!");
- System.out.println("**************************************************");
- System.out.println("Tippe 1 fuer den einfachen PP -> Geld Konverter");
- System.out.println("Tippe 2 fuer den Feature Rechner");
- System.out.println("Tippe 3 fuer den -20 % Baukosten Rechner");
- menu = s.nextInt();
- switch (menu) {
- /*Menu 1*/ case 1: {
- System.out.println("Um wieviel Premium Punkte geht es?");
- pp = s.nextDouble();
- pp1 = pp / 200 * 3.99;
- pp2 = pp / 600 * 9.99;
- pp3 = pp / 1500 * 19.99;
- pp4 = pp / 5000 * 49.99;
- pp5 = pp / 8500 * 79.99;
- System.out.println("// " + pp + " Premium Punkte kosten:");
- System.out.println("// " + pp1 + " Euro bei 3,99 Euro Käufen");
- System.out.println("// " + pp2 + " Euro bei 9,99 Euro Käufen");
- System.out.println("// " + pp3 + " Euro bei 19.99 Euro Käufen");
- System.out.println("// " + pp4 + " Euro bei 49,99 Euro Käufen");
- System.out.println("// " + pp5 + " Euro bei 79,99 Euro Käufen");
- break;
- }
- /*Menu 2*/ case 2: {
- System.out.println("Moechtest du den Premium-Account aktivieren?");
- String antwort1 = s.next();
- String ja = "ja";
- if (antwort1.equalsIgnoreCase(ja)) {
- System.out.println("Fuer welchen Zeitraum? (3, 7, 14 oder 30 Tage)?");
- tage = s.nextInt();
- if (tage == 3) {
- pp+=30;
- } else if (tage == 7) {
- pp+=60;
- pp+=30;
- } else if (tage == 14) {
- pp+=100;
- } else if (tage == 30) {
- pp+=200;
- }
- }
- System.out.println("Moechtestest du den Farm-Assistenten aktivieren?");
- String antwort2 = s.next();
- if (antwort2.equalsIgnoreCase(ja)) {
- System.out.println("Fuer welchen Zeitraum? (7 oder 30 Tage)?");
- tage = s.nextInt();
- if (tage==7) {
- pp+=10;
- } else if (tage == 30) {
- pp+=30;
- }
- }
- System.out.println("Moechtest du die +20 % schnellere Rohstoffproduktion aktivieren");
- String antwort3 = s.next();
- if (antwort3.equalsIgnoreCase(ja)) {
- System.out.println("Fuer wieviele Rohstoffquellen möchtest du dies aktivieren? (1, 2 oder 3)?");
- tage = s.nextInt();
- System.out.println("Fuer wieviel Wochen soll ich dir die Kosten berechnen?");
- wochen = s.nextInt();
- faktor = tage * 40 * wochen;
- pp+= faktor;
- }
- pp1 = pp / 200 * 3.99;
- pp2 = pp / 600 * 9.99;
- pp3 = pp / 1500 * 19.99;
- pp4 = pp / 5000 * 49.99;
- pp5 = pp / 8500 * 79.99;
- System.out.println("Das berechnet sich auf insgesamt " + pp + " Premium Punkte. \n");
- System.out.println("// " + pp + " Premium Punkte kosten:");
- System.out.println("// " + pp1 + " Euro bei 3,99 Euro Käufen");
- System.out.println("// " + pp2 + " Euro bei 9,99 Euro Käufen");
- System.out.println("// " + pp3 + " Euro bei 19.99 Euro Käufen");
- System.out.println("// " + pp4 + " Euro bei 49,99 Euro Käufen");
- System.out.println("// " + pp5 + " Euro bei 79,99 Euro Käufen");
- break;
- }
- /*Menu 3*/ case 3: {
- System.out.println("Bitte trage die Stufe des Gebaeudes auf deinem Dorf ein!");
- System.out.println("#######################################################");
- System.out.println("Hauptgebaeude?");
- hauptgebaeude = s.nextInt();
- System.out.println("Kaserne?");
- kaserne = s.nextInt();
- System.out.println("Stall?");
- stall = s.nextInt();
- System.out.println("Werkstatt?");
- werkstatt = s.nextInt();
- System.out.println("Schmiede?");
- schmiede = s.nextInt();
- System.out.println("Adelshof?");
- adelshof = s.nextInt();
- System.out.println("Marktplatz?");
- markt = s.nextInt();
- System.out.println("Holzfaeller?");
- holzfaeller = s.nextInt();
- System.out.println("Lehmgrube?");
- lehmgrube = s.nextInt();
- System.out.println("Eisenmine?");
- eisenmine = s.nextInt();
- System.out.println("Bauernhof?");
- bauernhof = s.nextInt();
- System.out.println("Speicher?");
- speicher = s.nextInt();
- System.out.println("Wall?");
- wall= s.nextInt();
- Menu3Ressi instanzDrei = new Menu3Ressi(hauptgebaeude, kaserne, stall, werkstatt, schmiede, adelshof, markt, holzfaeller, lehmgrube, eisenmine, bauernhof, speicher, wall, holz, lehm, eisen);
- System.out.println(instanzDrei.berechnung());
- break;
- }
- default: {
- System.out.println("Du musst mit 1, 2 oder 3 antworten.");
- break;
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement