Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

can you make three seperate flowchart for the function, integral, and main function? #include double function(double x) { return 5 * x * x +

can you make three seperate flowchart for the function, integral, and main function?

#include

double function(double x) { return 5 * x * x + 2 * x + 1; }

double integral(double lower_bound, double upper_bound, int intervals) { double delta_x = (upper_bound - lower_bound) / intervals; double result = 0.0; int i;

for (i = 1; i < intervals; i++) { double x = lower_bound + i * delta_x; result += function(x); }

result = (result + (function(lower_bound) + function(upper_bound)) / 2) * delta_x;

return result; }

int main() { double lower_bound, upper_bound; int intervals;

printf("Insert lower bound for the integral: "); scanf("%lf", &lower_bound);

printf("Insert upper bound for the integral: "); scanf("%lf", &upper_bound);

printf("Insert the intervals: "); scanf("%d", &intervals);

double result = integral(lower_bound, upper_bound, intervals); printf("The integral result from 5x^2 + 2x + 1 is: %lf ", result);

return 0; }

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

Conceptual Database Design An Entity Relationship Approach

Authors: Carol Batini, Stefano Ceri, Shamkant B. Navathe

1st Edition

ISBN: 0805302441, 978-0805302448

More Books

Students also viewed these Databases questions

Question

I:3-2 Contrast the accounting and economic concepts of income.

Answered: 1 week ago