Need help deriving a convertion function on python

Discussion in 'Python' started by johnnyukpo@gmail.com, Mar 7, 2013.

  1. Guest

    Good day,

    I have a computer programming assignment. I am completely lost and i need some help.

    These are the questions that are confusing me
    (a) Write a function which converts from gallons to cups2
    (b) Now we’d like to be able to convert from cups to milliliters, since metric measurements
    are easier to convert between. Implement a function which does this.
    (c) We’d also like to be able to easily convert gallons into milliliters,so implement a
    function which does this
    , Mar 7, 2013
    #1
    1. Advertising

  2. Rick Johnson Guest

    On Thursday, March 7, 2013 2:25:42 PM UTC-6, wrote:
    > I have a computer programming assignment. I am completely
    > lost and i need some help. These are the questions that
    > are confusing me
    >
    > (a) Write a function which converts from gallons to cups2


    How can we help you if we have no idea of what level of programming experience you have attained. Can you write functions? Can you declare variables? What about mathematics? If you can already do all these things then make anattempt to accomplish problem "(a)" and then ask us a specific question when you run into trouble.

    > (b) Now we’d like to be able to convert from cups to
    > milliliters, since metric measurements are easier to
    > convert between. Implement a function which does this.
    >
    > (c) We’d also like to be able to easily convert gallons
    > into milliliters, so implement a function which does this


    In due time grasshopper. First make an attempt to solve problem "(a)". Chris gave some great advice however i would like to insert a "step 0" into his"advice list" (this is python after all ;-).

    * STEP 0: Learn how to convert from gallons to cups using a
    pencil and paper only.

    * STEP 1: Read docs and learn about functions (if applicable).

    * STEP 2: Try to write a python function that will take one
    parameter (representing the number of gallons) and then
    perform the mathematical equations required to deduce the
    number of cups in a gallon, THEN return the result.
    Rick Johnson, Mar 7, 2013
    #2
    1. Advertising

  3. Dave Angel Guest

    On 03/07/2013 03:40 PM, Chris Angelico wrote:
    > On Fri, Mar 8, 2013 at 7:25 AM, <> wrote:
    >> Good day,
    >>
    >> I have a computer programming assignment. I am completely lost and i need some help.
    >>
    >> These are the questions that are confusing me

    <SNIP>
    >
    > By the way, you may
    > find the python-tutor list more suitable, if you feel your questions
    > are particularly basic:
    > http://mail.python.org/mailman/listinfo/tutor
    >


    Actually his brother 'akuma upko' (sharing the same account) posted the
    same question on Python-tutor 2 minutes before johnny posted it here.


    --
    DaveA
    Dave Angel, Mar 8, 2013
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    8
    Views:
    1,869
    Mike Treseler
    Feb 10, 2005
  2. isore
    Replies:
    0
    Views:
    519
    isore
    Jul 1, 2004
  3. Hiranya Samarasekera

    BMP to GIF convertion

    Hiranya Samarasekera, Aug 26, 2003, in forum: Java
    Replies:
    3
    Views:
    2,536
    Marco Schmidt
    Aug 27, 2003
  4. JustSomeGuy
    Replies:
    8
    Views:
    1,743
    Michiel Salters
    Jun 10, 2004
  5. Trans
    Replies:
    0
    Views:
    103
    Trans
    Jul 29, 2005
Loading...

Share This Page