1. This program will calculate value of the function for range of x and steps given in your variant. Use vectors x and y to store corresponding values of x and y. Make a C++ function my_func() to calculate value of y for the given x. Use tabulation '\t' to make an output that looks like a table. The output must be similar to following: My name is Alina Latipova. My variant is 0. Function is y = 4*x^4-3*x^2+6*x-7 -2.5 -2 116.5 34 X y -1.5 -1 -1.5 -11 -0.5 0 -9.5-6 0.5 1 -3.5 1 1.5 2 16.5 58 2.5 146.5

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question

 in c++, excute Function y = 0.05*x3+6sin(3x)+4, Range From -2.5 to 2.5, step 0.5, Specified value of
y =  -2, the image show the example of output, comment each line of code.

ED
2 of 2
+
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
Automatic Zoom
Total 2 times of sign changing
I 2 »
Transcribed Image Text:ED 2 of 2 + 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 Automatic Zoom Total 2 times of sign changing I 2 »
1 of 2
+
Automatic Zoom
1. This program will calculate value of the function for range of x and steps given in your variant. Use
vectors x and y to store corresponding values of x and y. Make a C++ function my_func() to calculate
value of y for the given x. Use tabulation '\t' to make an output that looks like a table. The output must be
similar to following:
My name is Alina Latipova. My variant is 0.
Function is y = 4*x^4-3*x^2+6*x-7
-1.5 -1 -0.5 0
-1.5 -11 -9.5 -6
1.5 2
16.5 58
y
-2.5 -2
116.534
2. The program also calculates max and min values for the given range. Use max_element() and
min_element() functions using algorithm header. The output must be similar to following:
Max value of function y for the given range is 146.5
Min value is -9.5
X
0.5 1
-3.5 1
2.5
146.5
3. The program must choose value of x from the given range which gives the value of function y closest
to the specified value of y. The output must be similar to following:
Value of function y specified 20
Closest value of function y is 16.5 for x = 1.5
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
+
I 2 »
Transcribed Image Text:1 of 2 + Automatic Zoom 1. This program will calculate value of the function for range of x and steps given in your variant. Use vectors x and y to store corresponding values of x and y. Make a C++ function my_func() to calculate value of y for the given x. Use tabulation '\t' to make an output that looks like a table. The output must be similar to following: My name is Alina Latipova. My variant is 0. Function is y = 4*x^4-3*x^2+6*x-7 -1.5 -1 -0.5 0 -1.5 -11 -9.5 -6 1.5 2 16.5 58 y -2.5 -2 116.534 2. The program also calculates max and min values for the given range. Use max_element() and min_element() functions using algorithm header. The output must be similar to following: Max value of function y for the given range is 146.5 Min value is -9.5 X 0.5 1 -3.5 1 2.5 146.5 3. The program must choose value of x from the given range which gives the value of function y closest to the specified value of y. The output must be similar to following: Value of function y specified 20 Closest value of function y is 16.5 for x = 1.5 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 + I 2 »
Expert Solution
steps

Step by step

Solved in 2 steps with 2 images

Blurred answer
Follow-up Questions
Read through expert solutions to related follow-up questions below.
Follow-up Question

create a flowchart for this function

Solution
Bartleby Expert
SEE SOLUTION
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY