Answer:
The solution code is written in Python:
- import math
-
- def getUserInput():
- deg = int(input("Enter an angle in degree: "))
- return deg
-
- def calculateRad(deg):
- return (deg * math.pi) / 180
-
- def printResult(deg, rad):
- print(str(deg) + " is equal to " + str(round(rad,2)) + " radian")
-
- degree = getUserInput()
- radian = calculateRad(degree)
- printResult(degree, radian)
Step-by-step explanation:
Since we need a standard Pi value, we import math module (Line 1).
Next, create a function getUserInput to prompt user to input degree (Line 3-5).
Next, create another function calculateRad that take one input degree and calculate the radian and return it as output (Line 7-8).
Create function printResult to display the input degree and its corresponding radian (Line 10-11).
At last, call all the three functions and display the results (Line 13-15).