dsun

Untitled

Jan 25th, 2013
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.71 KB | None | 0 0
  1.  
  2. public class test{
  3.  
  4. public static void main(String[] args){
  5. weaponShop();
  6. armorShop();
  7. magicShop();
  8. }
  9.  
  10. public static void weaponShop(){
  11. String[] weapon = {"Dagger", "Sword", "Flail", "Scythe"};
  12. int[] price = {75, 200, 650, 2750};
  13. int[] level = {1, 10, 25, 50};
  14. int[] power = {4, 18, 35, 75};
  15. System.out.println("The Weapon Shop\n");
  16. System.out.println("Weapon\tPrice\tLevel\tPower\n");
  17.  
  18. for(int i = 0; i < weapon.length && i < price.length && i < level.length && i < power.length; i++){
  19. System.out.println(weapon[i] + "\t" + price[i] + "\t" + level[i] + "\t" + power[i]);
  20. }
  21.  
  22. System.out.println("\nExit\n");
  23. }
  24.  
  25. public static void magicShop(){
  26. String[] scroll = {"Fire scroll", "Earth scroll", "Water scroll"};
  27. int[] price = {35, 75, 125};
  28. int[] level = {1, 5, 10};
  29. int[] power = {5, 15, 25};
  30. System.out.println("The Magic Shop\n");
  31. System.out.println("Scroll\t\tPrice\tLevel\tPower\n");
  32.  
  33. for(int i = 0; i < scroll.length && i < price.length && i < level.length && i < power.length; i++){
  34. System.out.println(scroll[i] + "\t" + price[i] + "\t" + level[i] + "\t" + power[i]);
  35. }
  36.  
  37. System.out.println("\nExit\n");
  38. }
  39.  
  40. public static void armorShop(){
  41. String[] armor = {"Shield", "Legs", "Body", "Helm"};
  42. int[] price = {175, 250, 500, 150};
  43. int[] level = {5, 7, 10, 5};
  44. int[] power = {4, 18, 35, 75};
  45. System.out.println("The Armor Shop\n");
  46. System.out.println("Armor\tPrice\tLevel\tPower\n");
  47.  
  48. for(int i = 0; i < armor.length && i < price.length && i < level.length && i < power.length; i++){
  49. System.out.println(armor[i] + "\t" + price[i] + "\t" + level[i] + "\t" + power[i]);
  50. }
  51.  
  52. System.out.println("\nExit\n");
  53. }
  54. }
Advertisement
Add Comment
Please, Sign In to add comment