Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

18. Write a Python program that calls the function computeCoords from question 17 to compute the points on a circle. Do NOI rewrite computeCoords here!

image text in transcribed
18. Write a Python program that calls the function computeCoords from question 17 to compute the points on a circle. Do NOI rewrite computeCoords here! There is NO function named main in [6] this program. . Input the integer number of intervals between the equally spaced X coordinates Loo p as long as the number of intervals is greater than zero. In the loop do the following: o Input the radius of the circle as a float. o If the radius of the circle is less than or equal to zero display an error message that includes the radius of the circle as shown in the sample run of the program. Otherwise do the following steps. Call computeCoords to get the lists of X and Y coordinates. o o Print a heading as shown in the sample run of the program. There must be a blank line in the output before the heading. In a loop do the following: o Print corresponding X and Y coordinates from the two lists on each line as shown in the sample run of the program. Print each coordinate to 14 decimal places in 21 er positions using exponential format. Separate the coordinates by 1 space. Input the integer number of intervals between the equally spaced X coordinates. o Display a message that contains the date and time the program is run as shown in the sample . run of the program. There must be a blank line in the output before the message. Be sure to include any import statements required by the program. A sample run of the program is shown below. Enter the number of intervals ( 0): -1 The radius of the circle, -1, must greater than zero! Enter the number of intervals (0): 2.5 Y Coordinate 0.00000000000000e+00 2.50000000000000e+00 2.50000000000000e-01 2.48746859276655e+00 5.00000000000000e-01 2.44948974278318e+00 7.50000000000000e-01 2.38484800354236e+00 1.00000000000000e+00 2.29128784747792e+00 1.25000000000000e+00 2.16506350946110e+00 1.50000000000000e+00 2.00000000000000e+00 1.75000000000000e+00 1.78535710713571e+00 2.00000000000000e+00 1.50000000000000e+00 2.25000000000000e+00 1.08972473588517e+00 2.50000000000000e+00 0.00000000000000e+00 x Coordinate Enter the number of intervals (

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

Practical Azure SQL Database For Modern Developers Building Applications In The Microsoft Cloud

Authors: Davide Mauri, Silvano Coriani, Anna Hoffma, Sanjay Mishra, Jovan Popovic

1st Edition

1484263693, 978-1484263693

More Books

Students also viewed these Databases questions

Question

7. Provide appropriate remediation when students fail.

Answered: 1 week ago