Can Someone help me. I am not a computer major, but need only one semester of c++ as a chem science major. Please tell me if I completed the coding correctly per instructions.
Write a program that
1)define a function of your choice using a subroutine (eg sin, parabola exp)
2)define two arrays of 100 points to store x and f(x). Call them for example x and y.
3)store using a loop in the arrays x values (equally spaced, e.g. 1) and the corresponding f(x) values in the y array
4) create a graph using TGraph (100 points) with x and y
5) create a canvas TCanvas
6)Draw the graph ( don't forget to use the options AP*)
7)create a function in root TF1 that is the same as in point 1
8)draw it on top of the graph using Draw with the option "same"
I cried in class because my teacher wrote this on my coding:
//this is not the program you were supposed to write, you were supposed to write a program making a graph with arrays and overlap a curve used for generating the points.
Are you asking us to do your assignment for you? I can't do that for you. It looks like this is a very advanced lesson--how have you been completing the lessons if you can't figure this one out(not to say this one is easy)?