Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I've been trying to get this code to match with what my professor wants but i can't seem to figure out how to do it.

image text in transcribedimage text in transcribedI've been trying to get this code to match with what my professor wants but i can't seem to figure out how to do it. He wants the one number to display .0 at the end but i can't seem to figure out how do do it. I've tried to do round(rods,2), but it keeps it as just saying 1. If you have any experience in python please help. The code i need help with is in line 30 and it is where i need it to display 1.0 instead of 1

Debugging Information for Test 1 Miles: 0.003 Furlongs: 0.025 Minutes to walk 1.0 rods: 0.06 pl PRETTY DIFF This diff is colored to make it clear what parts of the output are wrong. Green indicates things in the correct output that you are missing, red indicates things in your output that shouldn't be there The +character refers to newlines, so the green need to remove from your output. character refers a newline you are missing in your output and the red refers to a newline you Input rods: You input 10 rods. Conversions Meters: 5.029 Feet: 1.5 Miles: 0.003+ Furlongs: 0.025 Minutes to walk 1.0 rods: 0.06 18 feet round(rods*16.5,3) = Spyder (Python 3.7) D 2 @ BD HI c: F E} & f /Users/hryciuk/Desktop Editor-/Users/hryciuk/Desktop/pro 01. IPython console proj01. Console 1/A In [14]: 1.80 Out [14]: 1.0 2# Computer Project #1 3# This project is using your input of code to gather how far 4# away your destination is and how long it will take to get 5# In [151: runfile(Users/hryciuk/Desktop/proj 01.py", wdr-Users/hryciuk/Desktop') there. In this assignment I gathered the distance away that you had to travel (in rods) and changed the units to display various 6# Input rods: 1 You input 1 rods. Conversions Meters: 5.029 Feet: 16.5 Miles: 0.003 Furlongs: 0.825 Minutes to walk 1 rods: 0.06 7# kinds. I then used that distance and calculated approximately 8# how long it would take to arrive to your destination 10 11 num str1input( 'Input rods:') 12 #This is what first pops up when i run the code and prompts the 13#user to input the distance they are looking to travel (in Rods), 14 15 rodsround (int (num_str1),3) 16 metersround (rods*5.0292,3) 17 miles round (rods*.8031250078,3) 18 feet-round (rods*16.5,3) 19 furlong = round (rods*. 025,3) 20 walk round (rods/16.53329224,3) 21#This is where I defined each unit 22 #1 used the distance given (in rods) and used unit conversions to 23#display it in multiple different units 24 #1 also used the average walking distance that was given in miles 25#per hour and made it into rods per minute on a seprate sheet 26#Also, I rounded each of the results to the third decimal place 27#by putting round (x3) 28 29 In [16]: runfile(Users/hryciuk/Desktop/proj01.. wdr='/users/hryciuk/Desktop') Input rods: 1 You input 1 rods Conversions Meters: 5.029 Feet: 16.5 Miles: 0.003 Furlongs: 0.825 Minutes to walk 1 rods: 0.06 In [171: runfile'/Users/hryciuk/Desktop/proj01.py, wdir-/Users/hryciuk/Desktop) 30 print('You input', rods, 'rods.) 31 32 33 print('Conversions') 34 print( 'Meters:',meters) 35 print('Feet:",feet) 36 print('Miles: ,miles) 37 print('Furlongs:,furlong) 38 print('Minutes to walk', rods, 'rods:,walk) 39#This is where I choose what the user sees 40 # Input rods: 1 You input 1 rods. Conversions Meters: 5.029 Feet: 16.5 Miles: 0.003 Furlongs: 0.825 Minutes to walk 1 rods: 0.06 In [181: runfile(./Users/hryciuk/Desktop/projol.py. wdrs'/users/hryciuk/Desktop') ma Input rods: Permissions: RW End-of-lines: LF Encoding: ASCII Line: 30 Column: 23 Memory: 74%

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored 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

Recommended Textbook for

Database Marketing The Ultimate Marketing Tool

Authors: Edward L. Nash

1st Edition

0070460639, 978-0070460638

More Books

Students also viewed these Databases questions

Question

Contrast total slack and free slack.

Answered: 1 week ago