using System; namespace ConsoleApplication1 { /// /// Summary description for Class1. /// class Class1 { /// /// The main entry point for the application. /// [STAThread] static void Main(string[] args) { //Compute the cost of parking // < 1 hour -- $0.50 // between 1~2 hour -- $1.25 // > 2 hour -- $0.75 per hour double hours; double payment; Console.Write("Please input your parking time: "); hours = double.Parse(Console.ReadLine()); if(hours < 1 ) { payment = 0.5; } else { if(hours < 2) payment = 1.25; else payment = hours*0.75; } Console.WriteLine("Your total cost of parking is {0:C2}", payment); } } }