Computers and Technology

You work for a small company that exports artisan chocolate. Although you measure your products in kilograms, you often get orders in both pounds and ounces. You have decided that rather than have to look up conversions all the time, you could use Python code to take inputs to make conversions between the different units of measurement. You will write three blocks of code. The first will convert kilograms to pounds and ounces. The second will convert pounds to kilograms and ounces. The third will convert ounces to kilograms and pounds.
The conversions are as follows:
1 kilogram = 35.274 ounces
1 kilogram = 2.20462 pounds
1 pound = 0.453592 kilograms
1 pound = 16 ounces
1 ounce = 0.0283 kilograms
1 ounce = 0.0625 pounds
For the purposes of this activity the template for a function has been provided. You have not yet covered functions in the course, but they are a way of reusing code. Like a Python script, a function can have zero or more parameters. In the code window you will see three functions defined as def convert_kg(value):, def convert_pounds(value):, and def convert_ounces(value):. Each function will have a block showing you where to place your code.

answer
Answers: 1

Other questions on the subject: Computers and Technology

image
Computers and Technology, 21.06.2019 22:00, suyi14
What operating system is a smartphone most likely to use? 1.bsd 2.mac os x 3.symbian 4.linux
Answers: 1
image
Computers and Technology, 22.06.2019 16:00, sdonachy7
You have inserted new slides based on a word outline. how do you format these new slides to match the powerpoint presentation formatting? a. select all slides in the presentation and click format on the home tab. b. select the new slides and click reset on the home tab. c. select all slides in the presentation and click reset on the home tab. d. select the new slides and click format on the home tab.
Answers: 3
image
Computers and Technology, 23.06.2019 03:30, 890777
In vista and windows 7, the appearance and personalization option allows you to change the
Answers: 1
image
Computers and Technology, 23.06.2019 15:20, headshotplayzcod
In a game with three frames, where will the objects on layer 1 appear? a. next to the play area b. in the middle of the game c. behind everything else d. in front of everything else
Answers: 1
Do you know the correct answer?
You work for a small company that exports artisan chocolate. Although you measure your products in k...

Questions in other subjects: