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
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...
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 »](/v2/_next/image?url=https%3A%2F%2Fcontent.bartleby.com%2Fqna-images%2Fquestion%2F2038891b-1da1-4fac-91c5-dd8fac246fa2%2Ffa834ef4-567e-4fbc-bf05-a1edf45076d0%2Fzm6s2eh_processed.png&w=3840&q=75)
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 »](/v2/_next/image?url=https%3A%2F%2Fcontent.bartleby.com%2Fqna-images%2Fquestion%2F2038891b-1da1-4fac-91c5-dd8fac246fa2%2Ffa834ef4-567e-4fbc-bf05-a1edf45076d0%2F39g4ds_processed.png&w=3840&q=75)
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
![](/static/compass_v2/shared-icons/check-mark.png)
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
Step by step
Solved in 2 steps with 2 images
![Blurred answer](/static/compass_v2/solution-images/blurred-answer.jpg)
Follow-up Questions
Read through expert solutions to related follow-up questions below.
Recommended textbooks for you
![Computer Networking: A Top-Down Approach (7th Edi…](https://www.bartleby.com/isbn_cover_images/9780133594140/9780133594140_smallCoverImage.gif)
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…](https://www.bartleby.com/isbn_cover_images/9780124077263/9780124077263_smallCoverImage.gif)
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)](https://www.bartleby.com/isbn_cover_images/9781337569330/9781337569330_smallCoverImage.gif)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
![Computer Networking: A Top-Down Approach (7th Edi…](https://www.bartleby.com/isbn_cover_images/9780133594140/9780133594140_smallCoverImage.gif)
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…](https://www.bartleby.com/isbn_cover_images/9780124077263/9780124077263_smallCoverImage.gif)
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)](https://www.bartleby.com/isbn_cover_images/9781337569330/9781337569330_smallCoverImage.gif)
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](https://www.bartleby.com/isbn_cover_images/9781337093422/9781337093422_smallCoverImage.gif)
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
![Prelude to Programming](https://www.bartleby.com/isbn_cover_images/9780133750423/9780133750423_smallCoverImage.jpg)
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
![Sc Business Data Communications and Networking, T…](https://www.bartleby.com/isbn_cover_images/9781119368830/9781119368830_smallCoverImage.gif)
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY