Answered step by step
Verified Expert Solution
Question
1 Approved Answer
need to solve this with a python program thx Programming questions: 16. [20 points] Write a program to convert between pound (P) and kilogram (K)
need to solve this with a python program thx
Programming questions: 16. [20 points] Write a program to convert between pound (P) and kilogram (K) weights. The conversion formula is pounds = 2.2*kg. Requirements: - The program must first ask the user to choose the source units pounds (enter P) or kilograms (enter K) If the source unit is not P or K, the program will display a message 'Incorrect weight type!' and terminate. If the input unit is valid, the program will prompt the user to enter the weight value The program will output the converted weight with only one decimal place. Your program needs to match the following test cases; make sure your program produces the prompts/messages to the user in the same format as shown below (only displaying result value without matching the messages and formatting as below will result in reduced points): Test Case 1: Please enter K for kilograms or P for pounds: K Please enter the weight: 73.5 The converted weight is: 161.7 pounds. Test Case 2: Please enter K for kilograms or P for pounds: P Please enter the weight: 147.8 The converted weight is: 67.2 kilograms. Test Case 3: Please enter K for kilograms or P for pounds: A Incorrect weight type!
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started