Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

(These are rounded - Please do not search for the exact conversion formula, just use what is provided here.) When you design and code this

image text in transcribed
image text in transcribed
(These are rounded - Please do not search for the exact conversion formula, just use what is provided here.) When you design and code this program, follow these directions: 1. You must prompt the user for input. As an example: You may say Willam, please tell me how many miles you want converted to kilometers. "(You MUST address your cousin by name:) (LO 3, 5) 2. You will then store the input value in a variable (LO 2) 3. You will perform the conversion in an arithmetic expression. As an example, to convert from inches to centimeters you will multiply the inches by 2.54, which is the number of centimeters in an inch. You will then store the result of this multiplication in some variable named inches ToCm.(LO4,6) 4. After the calculation and assignment is complete, you will print the results. As an example, if you are converting 3 inches to centimeters, your output may resemble the following: William, 3 inches is equal to 7.62 centimeters. Isn't that amazingl (Your output MUST include verblage similar to the example given) (LO3,7) 5. Desk check your design and ensure that it does what it is meant to do (LO 1) 6. You will write the program using ONLY sequential statements ( no loops, iffelse, functions, lists) 7. You will convert ALL 5 measurements in ONE program. 8. Be sure to include comments and to format your output to 2 decimal places Part B: Code Use the design you created in part A. Write a complete and syntactically correct Python program. The program MUST contain comments and numeric values MUST be formatted to no more than 2 decimal places. Use the IDLE programming environment if you are using Python with IDLE. Some of you may be using Komodo or some other Python IDE. Please save your file as firstname. lastname_Lab2.py where you will replace firstname and lastname with your actual first name and last name. Remember to use the extension.py. Run and test your program. Once you are sure if works you will turn in the items listed in the next section. 1. Input, Process, Output 2. Basic Python syntax 3. Data types 4. Simple calculations 5. Formatting output This lab maps to leaming objectives 1, 2, 3,4, 5, 6, and 7 for Competency Two: Design and Code a Simple Program that Uses Variables and Performs Calculations Part A: Design a Solution ( LO 1.1, 1.2)1 This refers to the competency module leaming objective covered by this activity For this portion of the lab, you will design the solution to a simple program that uses sequential statements. (That means DO NOT use loops, functions, list, if/else, a menu etc...) in addition break, quit, exit, sys. exit, return, continue, or any other shortout ion NEVER allowed. You may draw a flowchart or write pseudocode. Remember that pseudo code CANNOT contain ANY language syntax, If you draw a flowchart, you will scan the drawing and submit it as a pof or jpeg file. Design a solution to the following problem: Your cousin is visiting from England and it is getting very annoying for you to constantly convert US measures to metric measures. After all, only 95% of the world uses the metric system. Using your programming prowess, you decide to write him a program that will perform the necessary conversions. (The program design will convert ALL 5 measurements and ask for a diferent value to convert for each measurement) But, wait, someone once told you that thours of planning can save you weeks of programming. " Keeping that in mind, you will first design a program that performs the following conversions: a. Miles to kilometers - one mile =1.6 kilometers b. Fahrenheit to Celsius - the formula to calculate is (F32)5/9 where F is the Fahrenheit temperature c. Gallons to liters - one gallon =3.9 liters d. Pounds to kilograms - one pound =0.45 kilograms e. Inches to centimeters - one inch =2.54 centimeters

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions