20. MyFinance.java

import java.io.*;
class MyFinance
{
public static void main(String[] args)
{
//declare storage for variables
double mySalary, myExpenses, myOverdraft, mySaving, surplus;
int years;

//initialise variables
mySalary=10000;
myExpenses=9500;
myOverdraft=20000;
mySaving=0;
years=0;

//calculate a value for surplus
surplus=mySalary-myExpenses;

//test for the condition then execute block
while (mySaving<myOverdraft)
{
mySaving=mySaving+surplus;
years++;
}//endwhile
//Print the result:
System.out.println("It is going to take you" +years+ 
"years to pay off your overdraft!");
}//end method definition
}