Commercial arithmetic in various languages
This is not actually a tutorial, but is a set of program examples which perform the same function in different programming
languages.
The task is to read a file of 80-byte images containing details of a number of model railway engines and do the following:
- Calculate the Gross Cost of all the models
- Calculate the Net Cost (by deducting 20% tax)
- Calculate the average price of each model, including tax.
Program source |
  |
Invoking Job Control Language |
  |
The results may vary due to differences in how the languages handle rounding when producing the two digits following the decimal place.