Logo 
Search:

MS Office Forum

Ask Question   UnAnswered
Home » Forum » MS Office       RSS Feeds

Program

  Asked By: Sienna    Date: Aug 15    Category: MS Office    Views: 550
  

After a while i have finally typed a code out but its not right
and i dont knw where im going rong.



Private Sub Simulate()

Dim n As Integer
Dim t As Integer
Dim t1 As Integer
Dim x As Integer
Dim y As Integer
Dim Vx As Integer
Dim row As Integer
Dim bounce_count As Integer
Dim Vy As Integer


x = 0
t = 0
y = h

row = ROW_PARAM_START
bounce_count = 0

While x <= d
ActiveSheet(n + 1, 2).Values = t
ActiveSheet(n + 1, 2).Values = x
ActiveSheet(n + 1, 2).Values = y

n = n + 1

x = Vx * t
y = h + Vy * t
t = h - 1 / 2 * G * t ^ 2
Vy = -G * t

If y >= h Then

End If


While bounce_count > 0 And x <= d
ActiveSheet(n + 1, 2).Values = t
ActiveSheet(n + 1, 2).Values = x
ActiveSheet(n + 1, 2).Values = y

n = n + 1

x = Vx * t
y = h + Vy * t
t = h - 1 / 2 * G * t ^ 2

If y >= h Then
y = h + Vy * t

End If

Wend


Wend

End Sub

Share: 

 

No Answers Found. Be the First, To Post Answer.

 
Didn't find what you were looking for? Find more on Program Or get search suggestion and latest updates.




Tagged: