4. The program will calculate average value of y for the given range. To find the average, use std::accumulate using algorithm header and divide by the number of elements. The output must be similar to following: Average value of function y for the given range is 31 5. The program must calculates the number of times and corresponding values of x where function y changes its sign in the given range (from positive to negative and from negative to positive). Use for loop and if statement. Sign of y changes its sign: Change 1 ‒‒‒‒‒‒ x=-2 y=34 x=-1.5 y=-1.5 Change 2 ---- x=0.5 y=-3.5 x=1_y=1 Total 2 times of sign changing

C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN:9781337102087
Author:D. S. Malik
Publisher:D. S. Malik
Chapter8: Arrays And Strings
Section: Chapter Questions
Problem 20PE
icon
Related questions
Question
100%

for the same equation "Function is y = 0.05 *x^3+6*sin(3*x)+4" bellow calculate 4 and 5, it's show how the output it is in the example. 

4. The program will calculate average value of y for the given range. To find the average, use
std::accumulate using algorithm header and divide by the number of elements. The output must be similar
to following:
Average value of function y for the given range is 31
5. The program must calculates the number of times and corresponding values of x where function y
changes its sign in the given range (from positive to negative and from negative to positive). Use for loop
and if statement.
Sign of y changes its sign:
Change 1
‒‒‒‒‒‒
x=-2 y=34
x=-1.5 y=-1.5
Change 2
----
x=0.5 y=-3.5
x=1_y=1
Total 2 times of sign changing
Transcribed Image Text:4. The program will calculate average value of y for the given range. To find the average, use std::accumulate using algorithm header and divide by the number of elements. The output must be similar to following: Average value of function y for the given range is 31 5. The program must calculates the number of times and corresponding values of x where function y changes its sign in the given range (from positive to negative and from negative to positive). Use for loop and if statement. Sign of y changes its sign: Change 1 ‒‒‒‒‒‒ x=-2 y=34 x=-1.5 y=-1.5 Change 2 ---- x=0.5 y=-3.5 x=1_y=1 Total 2 times of sign changing
Expert Solution
steps

Step by step

Solved in 8 steps with 4 images

Blurred answer
Knowledge Booster
Function Arguments
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr
COMPREHENSIVE MICROSOFT OFFICE 365 EXCE
COMPREHENSIVE MICROSOFT OFFICE 365 EXCE
Computer Science
ISBN:
9780357392676
Author:
FREUND, Steven
Publisher:
CENGAGE L