Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

please use simple if statements ( begginers coding ) no profesional coding Exercise#3: The Dubai metro ticket price depends on the number of stations in

image text in transcribed
image text in transcribed please use simple if statements ( begginers coding ) no profesional coding
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 : 25 AED Example 2: Enter the the number of stations: 3 16 Your ticket price is : 30 AED 2/4 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. Example! : Enter your transaction type: D Enter your old balance: 100 Enter the money for transaction : 20 Output: Your new balance is 120 Example2 1 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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Modern Database Management

Authors: Heikki Topi, Jeffrey A Hoffer, Ramesh Venkataraman

13th Edition

0134773659, 978-0134773650

More Books

Students also viewed these Databases questions