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 the graph 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 your function. 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 be written in the file and the name of the file to be created as arguments. The format of the function 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 as
in HW1. For example the statement calling the writemyfunc function is the main() function
should look something like:
writemyfunc("output.txt",0,1,0.01)
my equation :
f(x) = (1 + x)e −x