Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Will someone please explain to me where my mistake is? My professor graded my block of code and made a comment that there was no
Will someone please explain to me where my mistake is? My professor graded my block of code and made a comment that there was no output for the conversion DD to DMS and that DMS to DD does not read the input correctly. Thank you for your help in advance!
000 vu 1 from math import * 2 print("This project will calculate the conversion, the DMS to decimal degrees or decimal degrees to DMS, based on the user's choice.") #IF DMS Assignm 3 Conversion = input("Please inform which conversion to calculate. Enter DD for decimal degree or DMS for degree-minute-second.") #User's conversion cho 4. Conversion1 = float(input("Please input a decimal degree or DMS value: ")) #Decimal degree or DMS value to later be input by user 5 if (Conversion == 'DD'): #DMS to DD d = int(Conversion1) #Variable assignment for degrees dm = float((conversion1-d)*60) #Degrees to minutes minute = int(dm) #Variable assignment for minutes ms = int((dm-minute)*60) #Minutes to seconds sec = int(ms) #Variable assignment for seconds DD = (d + (minute/60) + (sec/3600)) #DMS to DD conversion formula 12 print(DD) #Printing the decimal degree value, result of the conversion 13 if (Conversion == 'DMS'): #DD to DMS d = int(Conversion1) #The whole/integer number of the decimal number provided minute = int((Conversion1-d) * 60) #The whole/integer number of the minutes sec = ((Conversion1 - d - (minute/60)) * 3600) #The seconds converted DMS = (d, minute, sec) #DD to DMS conversion formula print ("The degrees are {}, the minutes are {}, and the seconds are {}." .format(d, minute, sec)) 19 print(DMS) #Printing the DMS value, result of the conversion 11 A 15 16 17 18 1 from math import This project will calculate the conversion, the DMS to decimal degrees or decimal degrees to DMS, based on the user's choice.") #IF DMS Assignment conversion - input("Please inform which conversion to calculate. Enter DD for decimal degree or DMS for degree-minute-second.") #User's conversion choice conversioni = float(input("Please input a decimal degree or DMS value: ")) #Decimal degree or DMS value to later be input by user if (Conversion = 'DD'): #DMS to DD d = int(Conversion1) #Variable assignment for degrees dm = float((Conversion1-d)*60) #Degrees to minutes minute = int(dm) #Variable assignment for minutes ms = int((dm-minute)*60) #Minutes to seconds sec = int(ms) #Variable assignment for seconds DD = (d + (minute/60) + (sec/3600)) #DMS to DD conversion formula print(DD) #Printing the decimal degree value, result of the conversion if (Conversion == 'DMS'): #DD to DMS d = int(Conversion1) #The whole/integer number of the decimal number provided minute = int((Conversion 1-d) * 60) #The whole/integer number of the minutes sec = ((Conversioni - d - (minute/60)) * 3600) #The seconds converted DMS = (d, minute, sec) #DD to DMS conversion formula 18 print ("The degrees are {}, the minutes are {}, and the seconds are {}." .format(d, minute, sec)) print(DMS) #Printing the DMS value, result of the conversion 19
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