Need help deriving a convertion function on python

J

johnnyukpo

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
 
R

Rick Johnson

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.
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,057
Latest member
KetoBeezACVGummies

Latest Threads

Top