Advertisement
Guest User

Untitled

a guest
Mar 7th, 2014
122
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.75 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3.  
  4. public class PPRechner {
  5. public static void main(String[] args) {
  6.  
  7. @SuppressWarnings("resource")
  8. Scanner s = new Scanner(System.in);
  9.  
  10. int menu, tage, faktor, wochen, hauptgebaeude, kaserne, stall, werkstatt, schmiede, adelshof, markt, holzfaeller, lehmgrube, eisenmine, bauernhof, speicher, wall;
  11. double pp, pp1, pp2, pp3, pp4, pp5;
  12.  
  13. pp = 0;
  14.  
  15.  
  16. System.out.println("Willkommen beim Die Staemme Premium Punkte Rechner!");
  17. System.out.println("**************************************************");
  18. System.out.println("Tippe 1 fuer den einfachen PP -> Geld Konverter");
  19. System.out.println("Tippe 2 fuer den Feature Rechner");
  20. System.out.println("Tippe 3 fuer den -20 % Baukosten Rechner");
  21.  
  22. menu = s.nextInt();
  23. switch (menu) {
  24. /*Menu 1*/ case: 1 {
  25.  
  26. System.out.println("Um wieviel Premium Punkte geht es?");
  27. pp = s.nextDouble();
  28.  
  29. pp1 = pp / 200 * 3.99;
  30. pp2 = pp / 600 * 9.99;
  31. pp3 = pp / 1500 * 19.99;
  32. pp4 = pp / 5000 * 49.99;
  33. pp5 = pp / 8500 * 79.99;
  34.  
  35. System.out.println("// " + pp + " Premium Punkte kosten");
  36. System.out.println("// " + pp1 + " Euro bei 3,99 Euro Käufen");
  37. System.out.println("// " + pp2 + " Euro bei 9,99 Euro Käufen");
  38. System.out.println("// " + pp3 + " Euro bei 19.99 Euro Käufen");
  39. System.out.println("// " + pp4 + " Euro bei 49,99 Euro Käufen");
  40. System.out.println("// " + pp5 + " Euro bei 79,99 Euro Käufen");
  41.  
  42. break;
  43. }
  44.  
  45. /*Menu 2*/ case 2: {
  46.  
  47. System.out.println("Moechtest du den Premium-Account aktivieren?");
  48. String antwort1 = s.next();
  49. String ja = "ja";
  50.  
  51. if (antwort1.equalsIgnoreCase(ja)) {
  52.  
  53. System.out.println("Fuer welchen Zeitraum? (3, 7, 14 oder 30 Tage)?");
  54.  
  55. tage = s.nextInt();
  56. if (tage == 3) {
  57. pp+=30;
  58. } else if (tage == 7) {
  59. pp+=60;
  60. pp+=30;
  61. } else if (tage == 14) {
  62. pp+=100;
  63. } else if (tage == 30) {
  64. pp+=200;
  65. }
  66.  
  67. }
  68.  
  69. System.out.println("Moechtestest du den Farm-Assistenten aktivieren?");
  70. String antwort2 = s.next();
  71.  
  72. if (antwort2.equalsIgnoreCase(ja)) {
  73.  
  74. System.out.println("Fuer welchen Zeitraum? (7 oder 30 Tage)?");
  75.  
  76. tage = s.nextInt();
  77. if (tage==7) {
  78. pp+=10;
  79. } else if (tage == 30) {
  80. pp+=30;
  81. }
  82.  
  83. }
  84.  
  85. System.out.println("Moechtest du die +20 % schnellere Rohstoffproduktion aktivieren");
  86. String antwort3 = s.next();
  87.  
  88. if (antwort3.equalsIgnoreCase(ja)) {
  89.  
  90. System.out.println("Fuer wieviele Rohstoffquellen möchtest du dies aktivieren? (1, 2 oder 3)?");
  91.  
  92. tage = s.nextInt();
  93.  
  94. System.out.println("Fuer wieviel Wochen soll ich dir die Kosten berechnen?");
  95. wochen = s.nextInt();
  96.  
  97. faktor = tage * 40 * wochen;
  98. pp+= faktor;
  99.  
  100. }
  101. pp1 = pp / 200 * 3.99;
  102. pp2 = pp / 600 * 9.99;
  103. pp3 = pp / 1500 * 19.99;
  104. pp4 = pp / 5000 * 49.99;
  105. pp5 = pp / 8500 * 79.99;
  106.  
  107. System.out.println("Das berechnet sich auf insgesamt " + pp + " Premium Punkte. \n");
  108. System.out.println("// " + pp + " Premium Punkte kosten");
  109. System.out.println("// " + pp1 + " Euro bei 3,99 Euro Käufen");
  110. System.out.println("// " + pp2 + " Euro bei 9,99 Euro Käufen");
  111. System.out.println("// " + pp3 + " Euro bei 19.99 Euro Käufen");
  112. System.out.println("// " + pp4 + " Euro bei 49,99 Euro Käufen");
  113. System.out.println("// " + pp5 + " Euro bei 79,99 Euro Käufen");
  114.  
  115. break;
  116. }
  117.  
  118. /*Menu 3*/ case: 3 {
  119.  
  120. System.out.println("Bitte trage die Stufe des Gebaeudes auf deinem Dorf ein!");
  121. System.out.println("#######################################################");
  122.  
  123. System.out.println("Hauptgebaeude?");
  124. hauptgebaeude = s.nextInt();
  125. System.out.println("Kaserne?");
  126. kaserne = s.nextInt();
  127. System.out.println("Stall?");
  128. stall = s.nextInt();
  129. System.out.println("Werkstatt?");
  130. werkstatt = s.nextInt();
  131. System.out.println("Schmiede?");
  132. schmiede = s.nextInt();
  133. System.out.println("Adelshof?");
  134. adelshof = s.nextInt();
  135. System.out.println("Marktplatz?");
  136. markt = s.nextInt();
  137. System.out.println("Holzfaeller?");
  138. holzfaeller = s.nextInt();
  139. System.out.println("Lehmgrube?");
  140. lehmgrube = s.nextInt();
  141. System.out.println("Eisenmine?");
  142. eisenmine = s.nextInt();
  143. System.out.println("Bauernhof?");
  144. bauernhof = s.nextInt();
  145. System.out.println("Speicher?");
  146. speicher = s.nextInt();
  147. System.out.println("Wall?");
  148. wall= s.nextInt();
  149.  
  150. break;
  151. }
  152.  
  153.  
  154. default {
  155. System.out.println("Du musst mit 1, 2 oder 3 antworten.");
  156. break;
  157. }
  158. }
  159. }
  160. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement