Posts Tagged ‘NumberFormat’

Convert Inches to Centimetres

Java, Swing 14.10.2011 No Comments
Convert Inches to Centimetres

The next example was kindly shared by one of our members. She had a Java Swing assignment to create a Swing GUI for converting Inches to Centimetres and had no idea where to start. We helped her break down the problem and come up with a solution. The resulting code can be found below.

Read More

Simple Mortgage Calculator

Simple Mortgage Calculator

This example expands on the Monthly Payment Calculator example we posted earlier. As well as calculating the monthly payment for a loan, it then goes on to use that to calculate the balance of the loan after each payment. This is often referred to as an amortisation schedule. The displayMonthlyBalance() method handles generating the schedule…

Read More

Monthly Payment Calculator

Java 2.6.2010 1 Comment

This is the simplest form of one of the classic problems given to first year Java students. It aims to get you comfortable with the structure of a simple Java application and how to get input from the user. User input in this example is taken from the console (standard input). The Scanner class comes…

Read More
s2Member®