# Sounding rockets with c++

1. Nov 16, 2009

### Lord Dark

Hi guys,

I've got the following question :

and he want's me to :
I wrote the following code :
I've solved part 1,2,4 .. but the problem is in part 3 which I don't understand what the question means (I tried by maximum and minimum the velocity and acceleration but I get the first time which is wrong ... now I need your help guys :)
I've uploaded the data files (rocket3.txt) and the final results (how it should be)

#### Attached Files:

File size:
115.4 KB
Views:
117
• ###### rocket3.txt
File size:
1.5 KB
Views:
57
Last edited: Nov 17, 2009
2. Nov 17, 2009

### Lord Dark

guys I've got an idea but I don't know how to do it ,,

I wanna say when the acceleration goes from negative to positive record the time ,, but how can I say that in codes ??

3. Nov 17, 2009

### Staff: Mentor

Either remember sign of the last value in additional variable and go for (lastsignnegative && a > 0), or read all in the table and compare signs of neighboring values by something like (a < 0 && a[i+1] > 0). This is not bulletproof as if at some point a is zero you will probably miss it.

4. Nov 17, 2009

### Lord Dark

thanks Borek, but I don't know how to assign (lastsignnegative) to the last negative value and in the second way how to assign it in my code ?? i mean how to assign it to values of a if a is the acceleration and you've typed a(i) write it as a(a) ??

Last edited: Nov 18, 2009
5. Nov 18, 2009

### Lord Dark

thanks borek ,, I've got you now :) ,, solved :D thanks again