Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

A slice made by a chord that spans the sector is called a segment, as shown in the right figure of the above diagram. You

image text in transcribed
image text in transcribed
A slice made by a chord that spans the sector is called a segment, as shown in the right figure of the above diagram. You will write two functions to com and the segment. pute the areas of the sector 8. Write a function prototype and then its implementation called sector_area), computes the area of the entire sector. The function has two parameters: the radius r of the and the angle e (in radians) both of type double. The function returns the area of the sector whose value is of type double. The formula to compute the area of the sector is: 9. Write a function prototype and then its implementation called segment_area), which computes the area of the segment of the sector. The function has two parameters: the radius r of the circle and the angle e (in radians) both of type double. The function returns the area of the segment whose value is of type double. The formula to compute the area of the segment is: area = (9-sin(6)) 10. Thoroughly test your code. Initially use a radius of 1 and try different values for angle e, which must be expressed in radians! You are probably more familiar with angles expressed in degrees. Remember that 90 degrees /2 radians1.571 and 180 degrees n radians 3.142. Try your program using these radian values along with m/4 radians (45 degrees), 37/4 radians (135 degrees), ST/4 radians (225 degrees), and other radian values. Try different radius values other than 1. Compare your results with the solution sector_solution. exe. sing namespace std; FUNCTION PROTOTYPE FOR sector area FUNCTION PROTOTYPE FOR segment area DO NOT MODIFY THE MAIN ROUTINE IN ANY WAY int main() // Declare and initialize variables double circle-radius(0.0), angle-radians (8.0), area-sec (.0), area-seg(0.0) // Read circle radius cout circle radius; // Read circle angle cout angle radians: // Compute sector area area secsector area(circle_radius, angle_ radians); //Compute segment area area seg segment area(circle_ radius, angle radians); :**sector.cpp

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

Principles Of Multimedia Database Systems

Authors: V.S. Subrahmanian

1st Edition

1558604669, 978-1558604667

More Books

Students also viewed these Databases questions