none
What is wrong with this code RRS feed

  • Question

  • Here is a peice of code from my program on small basic. What is wrong

    Time:
    TextWindow.WriteLine("What is the Mass of object One, in Kg")
    Mass1=Textwindow.Read()
    TextWindow.WriteLine("Thank, now what is the Distance between the two object, in metres")
    Distance=Textwindow.Read()
    "g"=((1/Distance*Distance)/6.674*10^-11)*Mass1
    "T"=Math.SquareRoot(2*Distance/g)
    TextWindow.WriteLine("Thank you, the time it will take to have contact is "+T+" seconds")

    It says  "g" unexpected at this location

    and "T" unexpected at this location

    I have tried many things

    Wednesday, December 23, 2015 3:02 PM

Answers

  • Variables can't be surrounded by quotation marks.

    So,  "g"=((1/Distance*Distance)/6.674*10^-11)*Mass1

    should be,  g =((1/Distance*Distance)/6.674*10^-11)*Mass1

    Wednesday, December 23, 2015 10:23 PM
    Moderator

All replies