Advertisement
Guest User

Untitled

a guest
Sep 5th, 2015
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.29 KB | None | 0 0
  1. import java.util.Scanner;
  2. public class CostCalculator {
  3.  
  4. public static void main(String[] args) {
  5. Scanner user_input = new Scanner(System.in);
  6. System.out.println("Enter 'Hero' or 'Normal' for which class you wish to find the update cost for: ");
  7. int hero1,hero2,hero3,hero4,hero5,normal1,normal2,normal3,normal4,normal5;
  8. String choice;
  9. choice = user_input.next();
  10. if (choice.equals("Hero"))
  11. System.out.println("What level first line? 1-9");
  12. hero1 = Integer.parseInt(user_input.next());
  13. System.out.println("What level second line? 1-9");
  14. hero2 = Integer.parseInt(user_input.next());
  15. System.out.println("What level third line? 1-9");
  16. hero3 = Integer.parseInt(user_input.next());
  17. System.out.println("What level fourth line? 1-9");
  18. hero4 = Integer.parseInt(user_input.next());
  19. System.out.println("What level fifth line? 1-9");
  20. hero5 = Integer.parseInt(user_input.next());
  21.  
  22. // hero1 = hero1+1;
  23.  
  24. int[] cost = new int[8];
  25.  
  26. cost[0] = 50;
  27. cost[1] = 125;
  28. cost[2] = 300;
  29. cost[3] = 600;
  30. cost[4] = 3500;
  31. cost[5] = 6500;
  32. cost[6] = 8500;
  33. cost[7] = 14000;
  34.  
  35. int Price;
  36. Price = cost[hero1] + cost[hero2] + cost[hero3] + cost[hero4] + cost[hero5] * 2;
  37. System.out.println("This will cost you: " + Price);
  38.  
  39.  
  40.  
  41. }
  42.  
  43. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement