Created
January 8, 2018 09:09
-
-
Save elden1337/b10a84b57cd4c1ad4398b42e9d1f93be to your computer and use it in GitHub Desktop.
Swedish pawn-letter calculation for house purchases.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
using System.Threading.Tasks; | |
namespace Pantbrevskalkylator | |
{ | |
class Program | |
{ | |
static void Main() | |
{ | |
int purchasePrice = 0; | |
double cashInput = 0; | |
double pawnLetter = 0; | |
double tax = 0; | |
double pawnPrice = 0; | |
Console.WriteLine("Hur mycket ska du köpa för (inkl handpenning)?"); | |
int.TryParse(Console.ReadLine(), out purchasePrice); | |
tax = purchasePrice * 0.015; | |
tax = Math.Round(tax, 0); | |
Console.WriteLine("Hur mycket ligger i pantbrev?"); | |
double.TryParse(Console.ReadLine(), out pawnLetter); | |
pawnPrice = ((purchasePrice * 0.85) - pawnLetter) * 0.02; | |
cashInput = tax + pawnPrice + (purchasePrice * 0.15); | |
Console.WriteLine("\n"); | |
Console.WriteLine("Lagfart: " + tax + "kr"); | |
Console.WriteLine("Pantbrevsskuld: " + pawnPrice + "kr"); | |
Console.WriteLine("Köpesumma: " + purchasePrice + "kr"); | |
Console.WriteLine("-------------------------------------"); | |
Console.WriteLine("Total kontantinsats är minst: " + cashInput + "kr"); | |
Console.ReadLine(); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment