Ask Question
18 February, 14:35

Create an application in VB that allows the user to enter an object's mass, velocity, and height and displays the object's KE and PE. The application should have a two functions: KineticEnergy that accepts an object's mass (kilograms) and velocity (meters/second) as arguments and PotentialEnergy that accepts an object's mass (kilograms), acceleration due to gravity (m/s2), and height (meters) as arguments. The function should return the objects KE and PE (3 decimal places).

+2
Answers (1)
  1. 18 February, 17:52
    0
    see explaination

    Explanation:

    Module VBModule

    Function KineticEnergy (ByVal mass As Decimal, ByVal velocity As Decimal) As Decimal

    Dim result As Decimal

    result = 0.5*mass*velocity*velocity

    KineticEnergy = result

    End Function

    Sub Main ()

    Dim mass = Console. ReadLine ()

    Dim velocity = Console. ReadLine ()

    Console. WriteLine (FormatNumber (CDbl (KineticEnergy (mass, velocity)), 3))

    End Sub

    End Module
Know the Answer?
Not Sure About the Answer?
Get an answer to your question ✅ “Create an application in VB that allows the user to enter an object's mass, velocity, and height and displays the object's KE and PE. The ...” in 📙 Engineering if there is no answer or all answers are wrong, use a search bar and try to find the answer among similar questions.
Search for Other Answers