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")));
}
}
}
{"html5":"htmlmixed","css":"css","javascript":"javascript","php":"php","python":"python","ruby":"ruby","lua":"text\/x-lua","bash":"text\/x-sh","go":"go","c":"text\/x-csrc","cpp":"text\/x-c++src","diff":"diff","latex":"stex","sql":"sql","xml":"xml","apl":"apl","asterisk":"asterisk","c_loadrunner":"text\/x-csrc","c_mac":"text\/x-csrc","coffeescript":"text\/x-coffeescript","csharp":"text\/x-csharp","d":"d","ecmascript":"javascript","erlang":"erlang","groovy":"text\/x-groovy","haskell":"text\/x-haskell","haxe":"text\/x-haxe","html4strict":"htmlmixed","java":"text\/x-java","java5":"text\/x-java","jquery":"javascript","mirc":"mirc","mysql":"sql","ocaml":"text\/x-ocaml","pascal":"text\/x-pascal","perl":"perl","perl6":"perl","plsql":"sql","properties":"text\/x-properties","q":"text\/x-q","scala":"scala","scheme":"text\/x-scheme","tcl":"text\/x-tcl","vb":"text\/x-vb","verilog":"text\/x-verilog","yaml":"text\/x-yaml","z80":"text\/x-z80"}