Advertisement
Guest User

Untitled

a guest
Mar 19th, 2019
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.54 KB | None | 0 0
  1. String[] choices = { "1000", "1100", "1200", "1300", "1400", "1500",
  2. "1600", "1700", "1800", "1900", "2000", "2100",
  3. "2200", "2300", "2400", "2500", "2600", "2700"
  4. "2800", "2900", "3000", "Electric Car", "Motorbike" };
  5.  
  6. String input = (String) JOptionPane.showInputDialog(null, "Select engine size (in cc) or engine type",
  7. "Engine Size or Type Selector", JOptionPane.QUESTION_MESSAGE, null, choices, choices[0]);
  8. double taxAmount = 0;
  9. if (input == "1000")
  10. {
  11. taxAmount = 199;
  12. }
  13. else if (input == "1100")
  14. {
  15. taxAmount = 299;
  16. }
  17. else if (input == "1200")
  18. {
  19. taxAmount = 330;
  20. }
  21. else if (input == "1300")
  22. {
  23. taxAmount = 358;
  24. }
  25. else if (input == "1400")
  26. {
  27. taxAmount = 385;
  28. }
  29. else if (input == "1500")
  30. {
  31. taxAmount = 413;
  32. }
  33. else if (input == "1600")
  34. {
  35. taxAmount = 514;
  36. }
  37. else if (input == "1700")
  38. {
  39. taxAmount = 544;
  40. }
  41. else if (input == "1800")
  42. {
  43. taxAmount = 636;
  44. }
  45. else if (input == "1900")
  46. {
  47. taxAmount = 673;
  48. }
  49. else if (input == "2000")
  50. {
  51. taxAmount = 710;
  52. }
  53.  
  54. else if (input == "2100")
  55. {
  56. taxAmount = 906;
  57. }
  58.  
  59. else if (input == "2200")
  60. {
  61. taxAmount = 951;
  62. }
  63. else if (input == "2300")
  64. {
  65. taxAmount = 994;
  66. }
  67. else if (input == "2400")
  68. {
  69. taxAmount = 1034;
  70. }
  71. else if (input == "2500")
  72. {
  73. taxAmount = 1080;
  74. }
  75. else if (input == "2600")
  76. {
  77. taxAmount = 1294;
  78. }
  79. else if (input == "2700")
  80. {
  81. taxAmount = 1345;
  82. }
  83. else if (input == "2800")
  84. {
  85. taxAmount = 1391;
  86. }
  87. else if (input == "2900")
  88. {
  89. taxAmount = 1443;
  90. }
  91. else if (input == "3000")
  92. {
  93. taxAmount = 1494;
  94. }
  95. else if (input == "Electric Car")
  96. {
  97. taxAmount = 120;
  98. }
  99. else if (input == "Motorbike")
  100. {
  101. taxAmount = 88;
  102. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement