Question
7. Write a program in any language encoding the following algorithm: Given a function f(x): (Get user inputs) INPUT a, b = endpoints of
7. Write a program in any language encoding the following algorithm: Given a function f(x): (Get user inputs) INPUT a, b = endpoints of interval, n = number of intervals. (Do the integration) SET h = (b-a)/n. SET SUM = 0. DO FOR i = 1 TO n - 1 STEP 1 SET x = a + h * i, SET SUMSUM + 2 * f(x) ENDDO (FOR i). SET SUM = SUM + f(a) + f(b). SET ANSSUM * h/2. The value of the integral is given by ANS. -0.01
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get StartedRecommended Textbook for
Engineering Mechanics Statics
Authors: Russell C. Hibbeler
14th edition
978-0133918922
Students also viewed these Databases questions
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
View Answer in SolutionInn App