Ask Question
29 September, 10:17

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).

+4
Answers (1)
  1. 29 September, 10:24
    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?
Find 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 the answers seem to be not correct or there’s no answer. Try a smart search to find answers to similar questions.
Search for Other Answers