Calculate electricity bill
Page 1 of 1

Author:  moXsz [ Sat Mar 12, 2016 3:04 pm ]
Post subject:  Calculate electricity bill

how to create a program to calculate the electricity bill based on given domestic tariff.
i attached the picture for tariff rates
the program take the input from the user and calculate their bill based on the input given.
please help :cry: :(
thank you

File comment: tariff rates
Capture.JPG [ 49.78 KiB | Viewed 3155 times ]

Author:  fulgen [ Thu Mar 17, 2016 2:46 am ]
Post subject:  Re: Calculate electricity bill


Author:  der_richter [ Sun Dec 11, 2016 2:43 pm ]
Post subject:  Re: Calculate electricity bill

Based on some shady recollection of this (i am getting back into 68k after 15 years at least away from it), i would have a lookup-table where you set your tariffs. Then just take as input which tariff the user is on, then the consumption. All you would need then is to go to that index of the table to fetch the tariff, and multiply the consumed amount by that, store it in a suitable register and trap for output.

Page 1 of 1 All times are UTC
Powered by phpBB® Forum Software © phpBB Group