using static System.Console; using System.Globalization; using System; //declare using "static" before system and ".Console" after system namespace Lab3.Exercise._2_6 { class Program { static void Main(string[] args) //---- this is all input below ---- { //to have input you need to declare a variable //double (variable name) + Declare it with a integer (optional) const double BASE = 200; const double PER_HOUR = 150; //constants are always caps'ed const double PER_MILE = 2; double hours, miles, estimate; Write("Enter the number of hours:"); // = does not equal like normal - in computer program anything on the right hand side will be store in the variable hours // parenthesis is always executed first before the rest of the line. hours = Convert.ToDouble(ReadLine()); Write("How many miles is the move?:"); miles = Convert.ToDouble(ReadLine()); //---- calculation ---- estimate = BASE + PER_HOUR * hours + PER_MILE * miles; //---- Output ---- //For a move taking 25 hours and going 55 miles the estimate is $4,060.00 //uses placeholders -> {0} WriteLine("For a move taking {0} and going {1} miles", hours, miles); WriteLine("the estimate is {0}", estimate.ToString("C", CultureInfo.GetCultureInfo("en-US"))); //WriteLine("This is an example: {0}", estimate.ToString("C", CultureInfo.GetCultureInfo("en-US"))); } } }