Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- String[] choices = { "1000", "1100", "1200", "1300", "1400", "1500",
- "1600", "1700", "1800", "1900", "2000", "2100",
- "2200", "2300", "2400", "2500", "2600", "2700"
- "2800", "2900", "3000", "Electric Car", "Motorbike" };
- String input = (String) JOptionPane.showInputDialog(null, "Select engine size (in cc) or engine type",
- "Engine Size or Type Selector", JOptionPane.QUESTION_MESSAGE, null, choices, choices[0]);
- double taxAmount = 0;
- if (input == "1000")
- {
- taxAmount = 199;
- }
- else if (input == "1100")
- {
- taxAmount = 299;
- }
- else if (input == "1200")
- {
- taxAmount = 330;
- }
- else if (input == "1300")
- {
- taxAmount = 358;
- }
- else if (input == "1400")
- {
- taxAmount = 385;
- }
- else if (input == "1500")
- {
- taxAmount = 413;
- }
- else if (input == "1600")
- {
- taxAmount = 514;
- }
- else if (input == "1700")
- {
- taxAmount = 544;
- }
- else if (input == "1800")
- {
- taxAmount = 636;
- }
- else if (input == "1900")
- {
- taxAmount = 673;
- }
- else if (input == "2000")
- {
- taxAmount = 710;
- }
- else if (input == "2100")
- {
- taxAmount = 906;
- }
- else if (input == "2200")
- {
- taxAmount = 951;
- }
- else if (input == "2300")
- {
- taxAmount = 994;
- }
- else if (input == "2400")
- {
- taxAmount = 1034;
- }
- else if (input == "2500")
- {
- taxAmount = 1080;
- }
- else if (input == "2600")
- {
- taxAmount = 1294;
- }
- else if (input == "2700")
- {
- taxAmount = 1345;
- }
- else if (input == "2800")
- {
- taxAmount = 1391;
- }
- else if (input == "2900")
- {
- taxAmount = 1443;
- }
- else if (input == "3000")
- {
- taxAmount = 1494;
- }
- else if (input == "Electric Car")
- {
- taxAmount = 120;
- }
- else if (input == "Motorbike")
- {
- taxAmount = 88;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement