It is currently Sun Apr 22, 2018 10:27 am

All times are UTC

Post new topic Reply to topic  [ 3 posts ] 
Author Message
PostPosted: Sat Mar 12, 2016 3:04 pm 

Joined: Sat Mar 12, 2016 2:36 pm
Posts: 1
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 3152 times ]
PostPosted: Thu Mar 17, 2016 2:46 am 

Joined: Wed Apr 25, 2012 12:43 pm
Posts: 7

PostPosted: Sun Dec 11, 2016 2:43 pm 

Joined: Sat Dec 10, 2016 10:57 pm
Posts: 3
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.

Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC

Who is online

Users browsing this forum: No registered users and 1 guest

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group