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
# http:
# base_url: example.duckdns.org:8123
# Text to speech
tts:
- platform: google_translate
group: !include groups.yaml
automation: !include automations.yaml
script: !include scripts.yaml
sonoff:
username: [email protected]
password: pass
scan_interval: 60 #(optional)
grace_period: 600 #(optional)
api_region: 'eu' #polecam dodać
entity_prefix: True #usuwa prefix sonoff z nazw urządzeń
debug: False #(optional)
// 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")));
}
}
}