Question: c programing challenge. The code must mach how the sample run looks. You need to use and if statement and the modulo (%) operator for

c programing challenge. The code must mach how the sample run looks. You need to use and if statement and the modulo (%) operator for the error message part.  c programing challenge. The code must mach how the sample run
looks. You need to use and if statement and the modulo (%)

Their standard ferris wheel is illustrated below; the outer circle of the wheel has a radius of r units while the inner circle's radius is r. The angle between struts is e, where the distance between each of the outer points on the circle is d, and d, is the distance between the inner points on the inner circle. Because of manufacturing limitations 0 must always be a whole number, plus in order for the wheel to be anesthetically pleasing the distances between all of the outer points must be equal (i.e. d10 = du = d12 = ... = din = d.) which would make all of the inner circle distances equal to each other as well (i.e. d20 = d21 = dy = ... = den = d). struts outen points 9 00 d. 127 dal inger points Currently the company places a string of lights on both the exterior and interior rings. Mr. Johnson wondered if they could save money by running the lights from interior point to interior point (as straight lines) instead of wrapping them around the rings, i.e. how much shorter would the light strings be if they did it this way? Write a C program that inputs the radius of the ferris wheel and the angel 0 and then outputs the number of struts required plus both the point-to-point and around-the-circle distances for both rings. Your program should exit with an error message if the entered theta is incorrect (i.e. it must be a value that evenly divides (with no remainder) into 360). Also all of your prompts, labels, and output (except of course use your name instead of mine) should be formatted exactly as the sample fun below. Declare all floating point variables as type double. Also use the constant M_PI from math.h in your computations. 2 Sample Run Tuminoth-11-20 homebox:-/cprogs/% a.out D. Rester 2/21 radius? 122 theta (in degrees)? 6 line segment for outer ring: 12.770 line segment for inner ring: 6.385 number of struts - 60 length of outer lights point-to-point - 766.198 length of outer lights around circle - 766.549 length of inner lights point-to-point = 383.099 length of inner lights around circle = 383.274 homebox:-/cprogs/% homebox:-/cprogs/% a.out D. Resler 2721 radius? 122 theta (in degrees)? 7 Error! Incorrect theta. homebox:-/cprogs/%

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!