Hi, I’m struggling to figure out my issues with my code. There are…
Question Answered step-by-step Hi, I’m struggling to figure out my issues with my code. There are… Hi, I’m struggling to figure out my issues with my code. There are a few issues: For my volume output I need to change it so that it comes down to 2 decimal points not a bunch. I need to insert this at the bottom of my program :Gets the current date from the computer’s operating system.Opens a text file named volumes.txt for appending.Appends to the end of the volumes.txt file one line of text that contains the following five values:current date width of the tire aspect ratio of the tire diameter of the wheel volume of the tire Once you run the program there is a Syntax error, and I am having issues figuring out exactly what to do in order to fix it. If you could point me in the right direction, that would be great. Below is my current code : ”’tire_volume.py ”’from asyncore import writeimport mathfrom datetime import datetimetoday = datetime.date ()pi =math.piwidth = -1asp_ratio = -1diameter = -1 print(“To find the volume of your tire you will need to input the following info : “) while width < 0:width = float(input("What is the width (ex 205) : "))if width < 0:print("Please, make sure to enter a positive number.")if width > -1:print(” “) while asp_ratio < 0:asp_ratio = float(input("What is the aspect ratio (ex 60) : "))if asp_ratio < 0:print("Please, make sure to enter a positive number.")if asp_ratio > -1:print(” “) while diameter < 0:diameter = float(input("What is the diameter (ex 15) : "))if diameter < 0:print("Please, make sure to enter a positive number.")if diameter > -1:print(” “)volume = (pi * width * width * asp_ratio * (width * asp_ratio + 2540 * diameter))10000000000print(f”The approximate volume is {volume:.2f} liters.”)print()#Open volumes.txt and write latest data.f = open(‘volumes.txt’, ‘at’)print(f'{today:%Y-%m-%d}, {width}, {asp_ratio}, {diameter}, {volume:.2f}, ‘) Image transcription text8 v I … ~ tire_volume.py X ~ tire_volume.py > … O 1 tire_volume . py from asyncore import write import mathfrom datetime import datetime today = datetime. date () 10 pi =math. pi 11 width = -1 A 12 asp_ratio = -1 13diameter = -1 14 15 print (“To find the volume of your tire you will need to input the following i… Show more… Show more Computer Science Engineering & Technology Python Programming CSE 111 Share QuestionEmailCopy link Comments (0)


