VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



This program will compute the force of gravity on two objects by using their mass and the distance

by Spenser Newton (7 Submissions)
Category: Math/Dates
Compatability: VB 6.0
Difficulty: Unknown Difficulty
Originally Published: Mon 12th May 2003
Date Added: Mon 8th February 2021
Rating: (1 Votes)

This program will compute the force of gravity on two objects by using their mass and the distance between the masses to find the result.

Rate This program will compute the force of gravity on two objects by using their mass and the distance



Dim m1 As Single, m2 As Single, d As Single, g As Single, f As Single
m1 = Val(txtm1)
m2 = Val(txtm2)
d = Val(txtd)
g = 6.672 * 10 ^ (-11)
f = g * ((m1 * m2) / d ^ 2)
lblg = f
Printer.Print "Name, force of gravity on two masses prob."
Printer.Print "The weight of the first mass was/is "; txtm1
Printer.Print "The weight of the second mass was/is "; txtm2
Printer.Print "the distance between the two masses was/is "; txtd
Printer.Print "The Force of gravity on the masses was/is "; lblg
Printer.Print ""
End Sub

Private Sub cmdEnd_Click()
End
End Sub

Download this snippet    Add to My Saved Code

This program will compute the force of gravity on two objects by using their mass and the distance Comments

No comments have been posted about This program will compute the force of gravity on two objects by using their mass and the distance . Why not be the first to post a comment about This program will compute the force of gravity on two objects by using their mass and the distance .

Post your comment

Subject:
Message:
0/1000 characters