Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class CostCalculator {
- public static void main(String[] args) {
- Scanner user_input = new Scanner(System.in);
- System.out.println("Enter 'Hero' or 'Normal' for which class you wish to find the update cost for: ");
- int hero1,hero2,hero3,hero4,hero5,normal1,normal2,normal3,normal4,normal5;
- String choice;
- choice = user_input.next();
- if (choice.equals("Hero"))
- System.out.println("What level first line? 1-9");
- hero1 = Integer.parseInt(user_input.next());
- System.out.println("What level second line? 1-9");
- hero2 = Integer.parseInt(user_input.next());
- System.out.println("What level third line? 1-9");
- hero3 = Integer.parseInt(user_input.next());
- System.out.println("What level fourth line? 1-9");
- hero4 = Integer.parseInt(user_input.next());
- System.out.println("What level fifth line? 1-9");
- hero5 = Integer.parseInt(user_input.next());
- // hero1 = hero1+1;
- int[] cost = new int[8];
- cost[0] = 50;
- cost[1] = 125;
- cost[2] = 300;
- cost[3] = 600;
- cost[4] = 3500;
- cost[5] = 6500;
- cost[6] = 8500;
- cost[7] = 14000;
- int Price;
- Price = cost[hero1] + cost[hero2] + cost[hero3] + cost[hero4] + cost[hero5] * 2;
- System.out.println("This will cost you: " + Price);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement