misslady7270
New Member
- Joined
- Sep 29, 2012
- Messages
- 1
I have to create 3 different functions for class. I have to be able to create a function that converts metrics to English that is provided in a predefined drop down list. I need help with this and my assignment is due Monday morning so please help! Im beyond frustrate as I cant figure this out So I below are the metrics that are in the drop down list that I need to create the 1st function to return a value, then I also included the formulas we have to use to get
the conversions, and then the last function will be similar to the 1st one to return a value from the drop down list.
So for example if we are doing the 1st option from the dropdown list then I would need the 1st function to return a value of "pounds" then I need a function to return a value of the formula and the last function will need to return the value of "kilograms" . Please not that these functions need to work with whatever selection is made from the dropdown list w/ all the options I provided below.
<colgroup><col style="mso-width-source:userset;mso-width-alt:5302;width:109pt" width="145"> <col style="mso-width-source:userset;mso-width-alt:5924;width:122pt" width="162"> </colgroup><tbody>
</tbody>
the conversions, and then the last function will be similar to the 1st one to return a value from the drop down list.
So for example if we are doing the 1st option from the dropdown list then I would need the 1st function to return a value of "pounds" then I need a function to return a value of the formula and the last function will need to return the value of "kilograms" . Please not that these functions need to work with whatever selection is made from the dropdown list w/ all the options I provided below.
Metrics | Formulas |
Pounds to Kilograms | pounds * .4536 |
Kilograms to Pounds | kilograms * 2.2 |
Inches to Centimeters | 2.54*inches |
Centimeters to Inches | 0.3937*centimeters |
Farenheit to Celsius | ((farenheit - 32) * (5 / 9)) |
Celsius to Farenheit | (1.8 * celsius) + 32 |
Quarts to Liters | quarts * .9464 |
Liters to Quarts | liters * 1.057 |
Miles to Kilometers | miles * 1.609 |
Kilometers to Miles | kilometers * .6214 |
<colgroup><col style="mso-width-source:userset;mso-width-alt:5302;width:109pt" width="145"> <col style="mso-width-source:userset;mso-width-alt:5924;width:122pt" width="162"> </colgroup><tbody>
</tbody>