Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class test{
- public static void main(String[] args){
- weaponShop();
- armorShop();
- magicShop();
- }
- public static void weaponShop(){
- String[] weapon = {"Dagger", "Sword", "Flail", "Scythe"};
- int[] price = {75, 200, 650, 2750};
- int[] level = {1, 10, 25, 50};
- int[] power = {4, 18, 35, 75};
- System.out.println("The Weapon Shop\n");
- System.out.println("Weapon\tPrice\tLevel\tPower\n");
- for(int i = 0; i < weapon.length && i < price.length && i < level.length && i < power.length; i++){
- System.out.println(weapon[i] + "\t" + price[i] + "\t" + level[i] + "\t" + power[i]);
- }
- System.out.println("\nExit\n");
- }
- public static void magicShop(){
- String[] scroll = {"Fire scroll", "Earth scroll", "Water scroll"};
- int[] price = {35, 75, 125};
- int[] level = {1, 5, 10};
- int[] power = {5, 15, 25};
- System.out.println("The Magic Shop\n");
- System.out.println("Scroll\t\tPrice\tLevel\tPower\n");
- for(int i = 0; i < scroll.length && i < price.length && i < level.length && i < power.length; i++){
- System.out.println(scroll[i] + "\t" + price[i] + "\t" + level[i] + "\t" + power[i]);
- }
- System.out.println("\nExit\n");
- }
- public static void armorShop(){
- String[] armor = {"Shield", "Legs", "Body", "Helm"};
- int[] price = {175, 250, 500, 150};
- int[] level = {5, 7, 10, 5};
- int[] power = {4, 18, 35, 75};
- System.out.println("The Armor Shop\n");
- System.out.println("Armor\tPrice\tLevel\tPower\n");
- for(int i = 0; i < armor.length && i < price.length && i < level.length && i < power.length; i++){
- System.out.println(armor[i] + "\t" + price[i] + "\t" + level[i] + "\t" + power[i]);
- }
- System.out.println("\nExit\n");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment