EASy68K
http://easy68k.com/EASy68Kforum/

Calculate electricity bill
http://easy68k.com/EASy68Kforum/viewtopic.php?f=6&t=1542
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

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

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

┬┐Homework?

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.

Author:  JoePesto [ Thu Feb 23, 2017 7:45 am ]
Post subject:  Re: Calculate electricity bill

der_richter wrote:
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.


That sounds like the best way to do it.

Page 1 of 1 All times are UTC
Powered by phpBB® Forum Software © phpBB Group
http://www.phpbb.com/