Question: please for ex 6 use switch Exercise#3: The Dubai metro ticket price depends on the number of stations in a metro ride. The prices are

Exercise#3: The Dubai metro ticket price depends on the number of stations in a metro ride. The prices are as follows: From 1-5 stations ticket price is 15 AED From 6-10 stations ticket price is 20 AED From 11-15 stations ticket price is 25 AED More than 15 stations ticket price is 30 AED Write a program that will ask the user to input the number of first and last station in his ride, and will output the ticket price for this user. Example 1: Enter the number of first and last station: 13 15 Your ticket price is : 29 AED Example 2: Enter the the number of stations: 3 16 Your ticket price is : 30 AED icket price is : 24 Exercise#6: Write a program to ask the user for a transaction type, old balance, and the money amount for the transaction. Then it tells the user the new balance after the transaction. Use a switch statement to implement your solution. Possible transaction types are : 'D' or 'd' for deposite , 'W' or 'w' for withdraw , 'T' or 't' for transfer Examplel : Enter your transaction type: D Enter your old balance: 100 Enter the money for transaction : 20 Output: Your new balance is 120 Example2: 3/4 Enter your transaction type: W Enter your old balance: 100 Enter the money for transaction : 20 Output: Your new balance is 80 Example3 : Enter your transaction type: Enter your old balance: 100 Enter the money for transaction : 50 Output: Your new balance is 50
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
