Question: 1. Write a program that converts ounces to pounds, grams or kilograms, based on the user's choice: 4 Enter the number of ounces to

1. Write a program that converts ounces to pounds, grams or kilograms, based on the user's choice: 4 Enter Sample Run #2: In this run, grams are chosen. How many ounces do you want to convert? 12 Choose (p)ounds, (g)

1. Write a program that converts ounces to pounds, grams or kilograms, based on the user's choice: 4 Enter the number of ounces to convert. Enter the conversion type: ounces to pounds, grams or kilograms. The user's choice must be entered as a letter. . . Use if statements to determine what the ounces is converted into: If pounds are chosen: The pounds is ounces * 0.0625 Show how many pounds there are, with three decimal places. If grams are chosen: The grams is ounces * 28.34952 Show how many grams there are, with one decimal place. If kilograms are chosen: The kilograms is ounces * 0.02835 Show how many kilograms there are, with three decimal places. . If the choice is invalid: . State an appropriate error message. Sample Run #1: In this run, pounds are chosen. How many ounces do you want to convert? 12 Choose (plounde, (g) rams or (kilograna: p 12 ounces is 0.750 pounds. Acti Co to Sample Run #2: In this run, grams are chosen. How many ounces do you want to convert? 12 Choose (p)ounds, (g) rams or (k) ilograms: g 12 ounces is 340.2 grams. >>> Sample Run #3: In this run, kilograms are chosen. How many ounces do you want to convert? 12 Choose (p)ounds, (g) rams or (k)ilograns: k 12 ounces is 0.340 kilograms. Computing Science 111 Lab A Lab Assignment 4 (Fall 2023)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

Heres a Python program that converts ounces to pounds grams or kilograms based on the users choice I... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!