Write a program that calculates the cost of travelling using a private jet. The program must request the name of the destination and the distance (in kilometers) of the destination. The program must then calculate and print the name of the destination and the cost to get there. The table below gives the cost per mile that must be charged based on the distance. Cost per Distance (in kilometers) kilometer More than 0 but less than or equal to 140 kilometers 17.5 More than 140 but not more than 600 kilometers 12.25 More than 600 but less than 1450 kilometers 9.5 1450 kilometers or more 7.5 You may assume valid input is always entered.

C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN:9781337102087
Author:D. S. Malik
Publisher:D. S. Malik
Chapter4: Control Structures I (selection)
Section: Chapter Questions
Problem 20PE: The cost of renting a room at a hotel is, say $100.00 per night. For special occasions, such as a...
icon
Related questions
Question

write this program using c# and if else statements

Write a program that calculates the cost of travelling using a private jet.
The program must request the name of the destination and the distance (in kilometers) of the
destination. The program must then calculate and print the name of the destination and the
cost to get there.
The table below gives the cost per mile that must be charged based on the distance.
Cost per
Distance (in kilometers)
kilometer
More than 0 but less than or equal to 140 kilometers
17.5
More than 140 but not more than 600 kilometers
12.25
More than 600 but less than 1450 kilometers
9.5
1450 kilometers or more
7.5
You may assume valid input is always entered.
Transcribed Image Text:Write a program that calculates the cost of travelling using a private jet. The program must request the name of the destination and the distance (in kilometers) of the destination. The program must then calculate and print the name of the destination and the cost to get there. The table below gives the cost per mile that must be charged based on the distance. Cost per Distance (in kilometers) kilometer More than 0 but less than or equal to 140 kilometers 17.5 More than 140 but not more than 600 kilometers 12.25 More than 600 but less than 1450 kilometers 9.5 1450 kilometers or more 7.5 You may assume valid input is always entered.
Expert Solution
steps

Step by step

Solved in 2 steps with 1 images

Blurred answer
Knowledge Booster
Constants and Variables
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning