#!/bin/perl # works out how much VAT you've paid on a given amount # Change the amount on the next line for the VAT rate # Uses a while loop to allow multiple calculations $vat = 17.5; print "Please enter an amount paid including the VAT or 0 to quit "; $amount = ; while ($amount != 0) { $Vat = ( $amount - ($amount * 100 / (100 + $vat))); printf("You paid %.2f VAT\n", $Vat); print "Please enter another amount paid including the VAT "; $amount = ; }