Guest User

Untitled

a guest
Jan 16th, 2018
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.30 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace Pantbrevskalkylator
  8. {
  9. class Program
  10. {
  11. static void Main()
  12. {
  13. int purchasePrice = 0;
  14. double cashInput = 0;
  15. double pawnLetter = 0;
  16. double tax = 0;
  17. double pawnPrice = 0;
  18.  
  19. Console.WriteLine("Hur mycket ska du köpa för (inkl handpenning)?");
  20. int.TryParse(Console.ReadLine(), out purchasePrice);
  21.  
  22. tax = purchasePrice * 0.015;
  23. tax = Math.Round(tax, 0);
  24.  
  25. Console.WriteLine("Hur mycket ligger i pantbrev?");
  26. double.TryParse(Console.ReadLine(), out pawnLetter);
  27.  
  28. pawnPrice = ((purchasePrice * 0.85) - pawnLetter) * 0.02;
  29. cashInput = tax + pawnPrice + (purchasePrice * 0.15);
  30.  
  31. Console.WriteLine("\n");
  32. Console.WriteLine("Lagfart: " + tax + "kr");
  33. Console.WriteLine("Pantbrevsskuld: " + pawnPrice + "kr");
  34. Console.WriteLine("Köpesumma: " + purchasePrice + "kr");
  35. Console.WriteLine("-------------------------------------");
  36. Console.WriteLine("Total kontantinsats är minst: " + cashInput + "kr");
  37.  
  38. Console.ReadLine();
  39.  
  40. }
  41. }
  42. }
Add Comment
Please, Sign In to add comment