diff --git a/Exercise 2/Program.cs b/Exercise 2/Program.cs new file mode 100644 index 0000000..dc45eee --- /dev/null +++ b/Exercise 2/Program.cs @@ -0,0 +1,20 @@ +using System; + +namespace Exercise_2 +{ + class Program + { + static void Main(string[] args) + { + + Console.Write("Skriv in ett decimial tal: "); + double userInput = Convert.ToDouble(Console.ReadLine()); + + int rounded = (int)Math.Round(userInput, 0); + + Console.WriteLine("Svaret blir: " + rounded); + + + } + } +} diff --git a/Metoder-Exercise4/Program.cs b/Metoder-Exercise4/Program.cs new file mode 100644 index 0000000..38dcb12 --- /dev/null +++ b/Metoder-Exercise4/Program.cs @@ -0,0 +1,30 @@ +using System; + +namespace Metoder_Exercise4 +{ + class Program + { + static void Main(string[] args) + { + Console.Write("Skriv ett pris: "); + + int userInput = Convert.ToInt32(Console.ReadLine()); + + CountMoms(userInput); + + + } + + static void CountMoms(int value) + { + const double moms = 0.25; + + double medMoms = value * (moms + 1); + double utanMoms = value * moms; + + Console.WriteLine("Momsen är: " + utanMoms); + Console.WriteLine("Priset med moms blir: " + medMoms); + + } + } +}