I'm in a C++ programming class at my uni, and just received this assignment. I have no idea where to start, and was hoping you guys might be able to help. Thanks!
1. Integration.
Write a program to integrate an arbitrary time-‐domain signal, with a variable sample interval and variable limits of integration. Test your program on a simulated time-‐domain signal.
2. Differentiation.
Write a program to calculate the derivative of an arbitrary input function, with arbitrary duration and arbitrary limits. Remember to check that you start calculating at least at the second data point. Test your program on a simulated time-‐domain signal.
3. Write a program that creates an arbitrary sinusoidal waveform with parameters input from the user (via file or keystroke), passes the signal to a function that performs integration (from #1) and differentiation (#2) and receives the result and writes it to a file.
4. Write a program to perform an automated search of an input file and output the number of prime numbers contained in that file.
What do you mean? You need to integrate the function numerically. The TR does just that.
how can I program the derivative in
Suppose you have f evaluated in n equidistant points in the interval [0;k], such that you have the finite sequence a(i) = f(k*i/n). f'(k*i/n) can then be approximated by a(i+1) - a(i). You simply need to implement this.