Closed Thread
Results 1 to 3 of 3

Thread: Can anyone write this program for me?

  1. #1
    lunch39 is offline Newbie
    Join Date
    Dec 2009
    Posts
    1
    Rep Power
    0

    Can anyone write this program for me?

    I am a web design student and i have a programming assignment due on friday and I am just stumped. It has to be in ptyhon and it uses arrays which i just dont understand. this is the assignment...


    Write the Python code for the following programming problem. You have an option of writing the Pseudo code instead if you are looking for partial marks.

    The program/ pseudo code must be modular and have describing comments where ever required. I definitely want your name, date and purpose of the program in comments at the head of the program. You will be using arrays to solve this problem.

    Last year, a local college implemented rooftop gardens as a way to promote energy efficiency and save money. Write a program that will allow the user to enter the energy bills from January to December for the year prior to going green. Next, allow the user to enter the energy bills from January to December of the past year after going green. The program should calculate the energy difference from the two years and display the two years worth of data, along with the savings.

    Notes:
    1)The program should use arrays and must be modular.
    2)The program runs till the user decides to end the program. The user should enter “yes” (any combination of lower and upper case letters) if he/she wants to continue using the program.
    3)The energy bills can be any dollar value (integer or real) in the range 500-1000, both inclusive. Give error message in case of invalid input and force the user to give a value in the range.
    4)Printed dollar values must have a dollar sign and two digits after the decimal point.

    and this is what the output should look like...


    Your sample input might look as follows:

    Enter NOT GREEN energy costs for January
    Enter now -->789
    Enter NOT GREEN energy costs for February
    Enter now -->790
    Enter NOT GREEN energy costs for March
    Enter now -->890
    Enter NOT GREEN energy costs for April
    Enter now -->773
    Enter NOT GREEN energy costs for May
    Enter now -->723
    Enter NOT GREEN energy costs for June
    Enter now -->759
    Enter NOT GREEN energy costs for July
    Enter now -->690
    Enter NOT GREEN energy costs for August
    Enter now -->681
    Enter NOT GREEN energy costs for September
    Enter now -->782
    Enter NOT GREEN energy costs for October
    Enter now -->791
    Enter NOT GREEN energy costs for November
    Enter now -->898
    Enter NOT GREEN energy costs for December
    Enter now -->923
    -----------------------------------------------------

    Enter GONE GREEN energy costs for January
    Enter now -->546
    Enter GONE GREEN energy costs for February
    Enter now -->536
    Enter GONE GREEN energy costs for March
    Enter now -->519
    Enter GONE GREEN energy costs for April
    Enter now -->493
    Enter GONE GREEN energy costs for May
    Enter now -->472
    Enter GONE GREEN energy costs for June
    Enter now -->432
    Enter GONE GREEN energy costs for July
    Enter now -->347
    Enter GONE GREEN energy costs for August
    Enter now -->318
    Enter GONE GREEN energy costs for September
    Enter now -->453
    Enter GONE GREEN energy costs for October
    Enter now -->489
    Enter GONE GREEN energy costs for November
    Enter now -->439
    Enter GONE GREEN energy costs for December
    Enter now -->516

    Do you want to end program? (Enter no or yes): yes






    Your sample output must look as follows:

    SAVINGS
    __________________________________________________ ___
    SAVINGS NOT GREEN GONE GREEN MONTH
    __________________________________________________ ___

    $ 243.00 $ 789.00 $ 546.00 January

    $ 254.00 $ 790.00 $ 536.00 February

    $ 371.00 $ 890.00 $ 519.00 March

    $ 280.00 $ 773.00 $ 493.00 April

    $ 251.00 $ 723.00 $ 472.00 May

    $ 327.00 $ 759.00 $ 432.00 June

    $ 343.00 $ 690.00 $ 347.00 July

    $ 363.00 $ 681.00 $ 318.00 August

    $ 329.00 $ 782.00 $ 453.00 September

    $ 302.00 $ 791.00 $ 489.00 October

    $ 459.00 $ 898.00 $ 439.00 November

    $ 407.00 $ 923.00 $ 516.00 December

    Any help or advice would be greatly appreciated, Even if anyone knows how to write it in psuedo-code that will work...I just need to submit something and I am terrible at programming!

  2. CODECALL Circuit advertisement
    Join Date
    Always
    Posts
    Many

     
  3. #2
    Phazic is offline Newbie
    Join Date
    Nov 2009
    Posts
    7
    Rep Power
    0

    Re: Can anyone write this program for me?

    i'd say check out the tutorial section,
    everything is well explained there.
    And at least start and try to do something,
    instead of asking people to solve it for u,
    that won't help u improve your programming (skills).

  4. #3
    jwxie518's Avatar
    jwxie518 is offline Speaks fluent binary
    Join Date
    Jan 2009
    Location
    New York City
    Posts
    1,175
    Blog Entries
    1
    Rep Power
    19

    Re: Can anyone write this program for me?

    I know it's too late to reply and nobody will do homework for you (just keep in mind).

    This is a very fun program, I might do it over the break just to practice python.
    Array? Doesn't python treat everything like array (list, dictionary)???
    there are only a few keywords really matter (beside lists)
    for loop
    range, len

    something like that can write a okay-ish program with a lot of codes.
    http://i3physics.com/blog
    *-*-*-*__ C++ revolutionized the modern programming language, but what happen to C+? Programming is just a study of chemistry __*-*-*-*

Closed Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. How to write a C++ Self unpacking program?
    By bbqroast in forum C and C++
    Replies: 4
    Last Post: 10-16-2011, 09:40 PM
  2. Simpler way to write this program
    By Edu in forum Python
    Replies: 8
    Last Post: 01-27-2011, 09:03 PM
  3. how to write tis program code
    By 2612 in forum C and C++
    Replies: 12
    Last Post: 12-18-2010, 12:11 PM
  4. How to write a program that evaluates min/max val..
    By JaaneKyun in forum C and C++
    Replies: 5
    Last Post: 05-14-2010, 08:35 AM
  5. How to write program for gmail?
    By ecoecoeco in forum Visual Basic Programming
    Replies: 1
    Last Post: 04-10-2010, 08:43 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts