1. Write a program that converts ounces to pounds, grams or kilograms, based on the user's...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
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) 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)
Expert Answer:
Answer rating: 100% (QA)
Heres a Python program that converts ounces to pounds grams or kilograms based on the users choice I... View the full answer
Related Book For
Income Tax Fundamentals 2013
ISBN: 9781285586618
31st Edition
Authors: Gerald E. Whittenburg, Martha Altus Buller, Steven L Gill
Posted Date:
Students also viewed these programming questions
-
J. P. Robard Mfg., Inc. Balance Sheet ($000) Cash $540 Accounts receivable 2,010 Inventories 1,040 Current assets $3,590 Net fixed assets 4,440 Total assets $8,030 Accounts payable $1,080 Accrued...
-
31% of American adults surveyed stated that giving up their phone for a day would be more difficult than giving up their significant other. In 2012, the United States population over the age of 18...
-
Will has asked that you create a Pay Calculator program, with the following variables at minimum, you can add more variables if needed. Components PayRate HoursWorked BonusPercentage TaxPercentage...
-
A common stock pays an annual dividend that increases by 4% annually and sells for $35 per share. If the market rate of return on this stock is 8%. What is the amount of the ?last dividend paid $1.53...
-
Why is the historical data approach appropriate for pricing a weather derivatives contract and a CAT bond?
-
The Intel 8088 consists of a bus interface unit (BIU) and an execution unit (EU), which form a 2-stage pipeline. The BIU fetches instructions into a 4-byte instruction queue. The BIU also...
-
Use the USDA Quick Stats service (http://quickstats.nass.usda.gov//) to compare the 2009 oat yields between New York and California. What additional land would California require to meet the same...
-
The accounts listed below appeared in the December 31 trial balance of the Savard Theater. Instructions(a) From the account balances listed above and the information given below, prepare the annual...
-
What is trust, and how does it relate to justice and ethics? Do you agree that smartphone use has decreased the kinds of reflection that might deepen ethical maturity? Do you think that society has...
-
Jackie Wengler, owner of Wengler Home Decorating Service, has requested that you prepare from the following balances (a) An income statement for June 201X, (b) A statement of owner?s equity for June,...
-
The CELUImpacto operator, with branches in Chile, Argentina, Brazil, Colombia and Mexico, needs to improve the quality of the services offered, because it has recently presented various failures...
-
According to Modigliani and Miller, shareholders are indifferent between a dividend and a capital gain. Comment on this statement, which you have overheard.
-
A graph of the daily price of a share looks similar to that which would be obtained by plotting a series of cumulative random numbers. This shows clearly that share prices move randomly at the whim...
-
Given only the original problem parameters, would you recommend upgrading to either RAID 0 or RAID 1 assuming individual disk parameters remain the same in the previous table? For disks in the table...
-
Assume that we are considering the survival of whales and that if the number of whales falls below a minimum survival level m, the species will become extinct. Assume also that the population is...
-
You have overheard the following statement: According to portfolio theory, shares are priced on the basis of their systematic riskiness. This means, therefore, that a piece of bad news relating only...
-
Obtain the inverse Laplace transform x(t) for each of the following transforms: 2s+3 s +6s+25 2s+3 s(s+6s+25) a. X(s) = b. X(s) =
-
Determine the values of the given trigonometric functions directly on a calculator. The angles are approximate. tan 0.8035
-
Cedar Corporation has an S corporation election in effect. During the 2012 calendar tax year, the corporation had ordinary taxable income of $200,000, and on January 15, 2012, the corporation paid...
-
Rebecca and Walter Bunge have been married for 5 years. They live at 883 Scrub Brush Street, Apt. 52B, Las Vegas, NV 89125. Rebecca is a homemaker and Walt is a high school teacher. Rebecca's Social...
-
The following additional information is available for the Dr. Ivan and Irene Incisor family from Chapters 1-6. On December 12, Irene purchased the building where her store is located. She paid...
-
Following up the study referred to in Exercise 19.5, Hraba and Grant (1970) repeated the Clark and Clark study. The studies were not exactly equivalent, but they were close enough and the results are...
-
Combine the data from Exercises 19.5 and 19.6 into a two-way contingency table and run the appropriate test. How does the question that the two-way classification addresses differ from the questions...
-
How would you modify the analysis of the data in Exercise 19.8 if you also had the data on smoking behavior of the partners of these women? Exercise 19.8 We know that smoking has all sorts of ill...
Study smarter with the SolutionInn App