Q2.
Question
Modify the given program so that it will use 1000 smaller rectangles with base vertices at to approximate the area of the shaded region. RUN the program.
Step-by-Step Solution
VerifiedArea is approximately .
The shaded region is bounded by the graph of , by the x-axis , and by the vertical line through the points and .
The program for calculating the area of shaded region using 10 rectangles :
We can approximate the area of the shaded region by drawing rectangles having base vertices atand computing the sum of the areas of the1000 rectangles. The base of each rectangle is , and the height of each rectangle is given by
The following comuter program will comute and add the areas of the 1000 rectangles.In line30Y is the height of each rectangle.In line 40A, A gives the current total of all the areas.
Therefore, If the program is run, the computer will print AREA IS APPROXIAMTELY