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

User Generated

lnffrezf

Programming

VA

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

User generated content is uploaded by users for the purposes of learning and should be used following Studypool's honor code & terms of service.

Explanation & Answer

Ch...


Anonymous
I was stuck on this subject and a friend recommended Studypool. I'm so glad I checked it out!

Studypool
4.7
Trustpilot
4.5
Sitejabber
4.4

Related Tags