homework my equation is : ​ f(x) = (1 + x)e −x​

Question Description

Notes:

• Make sure every line of your code has a comment that explain what it does.

• Submit the c++ code (all files with extensions .cpp or .h), the text file created and thegraph through Blackboard.

• write the two functions in a separate .cpp file and write the declarations in a separate.h file and include it into your main program.

Problem 1:

Write a C++ function that receives an argument x and returns the calculated value of yourfunction. Name your function myfunc. The format of the function heading should look like:double myfunc(double x)

Problem 2:

Write a function that writes the values of your function with the format indicated in Homework 1. The function should receive the bracket and the interval of the values that will bewritten in the file and the name of the file to be created as arguments. The format of thefunction heading should look like:void writemyfunc(string filename, double start, double end, double interval=0.01)

Problem 3

Modify your program in Homework 1 to use these functions to reproduce the same results asin HW1. For example the statement calling the writemyfunc function is the main() functionshould look something like:writemyfunc(“output.txt”,0,1,0.01)

my equation :

f(x) = (1 + x)e−x

Get your college paper done by experts

Do my question How much will it cost?

Place an order in 3 easy steps. Takes less than 5 mins.

0 replies

Leave a Reply

Want to join the discussion?
Feel free to contribute!

Leave a Reply

Your email address will not be published. Required fields are marked *