Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

The Whippet Bus Company charges prices for tickets based ondistance traveled, as

ID: 3618791 • Letter: T

Question

The Whippet Bus Company charges prices for tickets based ondistance traveled, as follows:

Write a program that allows a user to enter a tripdistance. The output is the ticket price

Distance (miles) Ticket Price ($) 0-99 25.00 100-299 40.00 300-499 55.00 500 and farther 70.00

Explanation / Answer

Here is the c# code using System; using System.Collections.Generic; using System.Text; namespace Test {     class Program     {         static voidMain(string[] args)         {            Console.WriteLine("Please enter the distance : ");            int distance = Int32.Parse(Console.ReadLine());            if (distance >= 0 && distance = 100 && distance = 300 && distance = 500)            {                Console.WriteLine("Ticket Price = $70.00");            }            else            {                Console.WriteLine("Invalid Distance");            }            Console.ReadLine();         }       } }
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote