this is my first post, i have just started c programing and having some difficulties. I hope someone can help me on this website.
i am programing in c++, to be specific.
i have to write a c program which calculates the area under a curve using the simson rule.
simpson rule : Yn+1=Yn-1+1/3[Xn+1+4Xn+Xn-1]
data points, sould be read from standard input using scanf(). when no more data is available from input then the area and some discription should be written to standard output using printf().
-a seperate function called simpson() must be written which calculates each new increment of area using three current data points
-every secon data point must be used as a centre for evaluating the area using three data points( the centre point is Xn)
-the main() only reads the input, accumalates the situation, keeps track of the cauurent values of x and y, and finally prints the results.
i kind of no whats going onm im goin to use a y variable , 3 x variables, a total variable and a null character to exit the while loop.(does this sound about right?)
im sorry for the long post just wanted to make sure i made sence, im getting some tutoring tomorow but i wanted some help on getting started first.
thanks very much.any help is appritiated.