Home > Software engineering >  Please bosses to see detailed code about the rocket speed
Please bosses to see detailed code about the rocket speed

Time:02-17

Design a rocket program, which requires the rockets from slow to fast,

CodePudding user response:

A form, a button, a timer
A pixel represents 1 m

 
Option Explicit
Dim the rockets quality As Double
Dim rocket thrust As Double
Dim As Double 'S displacement
As Double Dim V
Private Sub Command1_Click ()


'according to the data, the long March 5 a take-off thrust 8.179 million cattle off quality 622.5 t
The rocket thrust=8179 'unit: thousands of cattle
The rockets quality=622.5 'unit: thousands of kilograms of

Me. The ScaleMode=3
V=0 'velocity and displacement are 0
S=0
Timer1. Interval=100 'computing time Interval 0.1 seconds
Timer1. Enabled=True
End Sub

Private Sub Timer1_Timer ()

Me. Cls
V=V + (rocket thrust rocket quality * 9.8)/rocket quality * 0.1
S=S + V * 0.1
'a pixel represents 1 meter height
Me. Circle (Me. ScaleWidth/2, Me. ScaleHeight -s), 2, vbRed

End Sub

  • Related