Login
Search   Moderators Wanted: If you're interested please send your portfolio to info[at]itechforums.com
Welcome to the iTechForums.
If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.
To register now click here.
Latest Threads
Advertisements
Forum Statistics
Threads:
Posts: 1
Members:
Number of Users Online:
Welcome to our newest member,
Reply
 
Thread Tools Display Modes
  #1  
Old 02-17-2010, 07:12 PM
Gene Gene is offline
Junior Member
 
Join Date: May 2008
Posts: 4
Default

Computer Science Pseudocode Algorithm problem?


Computer Science Pseudocode Algorithm problem?

I need to create an algorithm for the following problem in Pseudo-code.
Write an algorithm that is given your electric meter reading (in
kilowatt-hours) at the beginning and end of each month of the year.
The algorithm determines your annual cost of electricity on the basis
of a charge of .06 cents per kilowatt-hour for the first 1000
kilowatt-hours of each month and .08 cents per kilowatt-hours beyond
1000.After printing your total annual charge, the algorithm also
determines whether you used less than 500 kilowatt-hours for the
entire year. If so, it prints out a message thanking you for
conserving electricity.

My main issue is that I do not know how I would keep the totals for each month separate without creating a different input for each one.
This is what I have so far:
Months (M) = 1
While M 12
Input Beginning of Month (B)
Input End of Month (E)
Monthly total (MT) = E-B
IF MT1000
Overage (O) = MT - 1000
Overage-Cost (OC) = O * .08
MT - O = Non-overage (NO)
Non-overage Cost (NOC) = NO * .06
Monthly Cost (MC) = NOC + OC
Else
MT *.06 = MC

And then I am stuck. because that just calculates 1 month. Any help would be greatly appreciated.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Math Algorithm in Computer Science? PhilipJohn Software Design & Algorithms 1 02-04-2010 03:47 PM
Computer Science and Algorithm Help? Rex J Software Design & Algorithms 0 12-25-2009 02:38 PM
Computer science/Math problem prove an algorithm terminates almost surely? Kitty M Software Design & Algorithms 0 12-13-2009 05:55 PM
Computer Science Help! Creating an algorithm? Toni22 Software Design & Algorithms 0 09-21-2009 11:55 PM
Programing Problem, Pseudocode/Algorithm? Theresa L Software Design & Algorithms 0 06-28-2009 06:27 AM

Your Ad Here

All times are GMT. The time now is 03:31 AM.