distance converter

JavaScript

//get user input
var centimetres = prompt('Enter distance in centimetres: ');

//convert user input to an integer (number) 
centimetres = parseInt(centimetres);

//add formula to convert centimetres to inches
var inches = centimetres / 2.54;

//convert again - from integer to a string
centimetres = centimetres.toString();
inches = inches.toString();

//output concatenation
document.write('You entered ' + centimetres + ' cm, which is ' + inches + ' inches.');