How to Calculate My Pension.

  • Thread starter Thread starter Pofche
  • Start date Start date
P

Pofche

Guest
Hi

The end result should say: Hi bla bla. You have bla bla years left to your pension.

I tried every type on angel but I just cant figure it out. The book is not much of a help so im stuck. Please help me.



int Pension = 65;
int Age;
int (summa = Convert.ToInt32summa);


string inmatning;
Console.WriteLine("Vad heter du i förnamn?");// Whats your name?
string username = Console.ReadLine();
Console.WriteLine("Vad heter du i efternamn?");// Whats your last name?
string lastname = Console.ReadLine();
Console.WriteLine("Vad är din ålder?");// Whats your age?
inmatning = Console.ReadLine();
string summa = Console.ReadLine();

Age = int.Parse(inmatning);
Console.ReadLine();
inmatning = Console.ReadLine();
Pension = int.Parse(inmatning);
summa = Age - Pension;
Console.WriteLine("Age är " + Age + "och Pension är " + Pension + ". Summa är " + summa);


Console.WriteLine(" Hi {0} {1}. Du har {2} år kvar till din pension. ", username, lastname, summa);// summa is the result.


Console.ReadKey(true);

Continue reading...
 
Back
Top