Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Sign In with Facebook Sign In with Google Sign In with OpenID

Categories

We have migrated to a new platform! Please note that you will need to reset your password to log in (your credentials are still in-tact though). Please contact lee@programmersheaven.com if you have questions.
Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

PIPPIN

who can write a program for the following:

W = X + Y * 3 if x to value of 6 and Y to 9

W = x/4+y * 36y/x x to value of 18 and y to 2



Comments

  • DrMartenDrMarten Posts: 748Member
    [b][red]This message was edited by DrMarten at 2006-8-3 12:30:42[/red][/b][hr]

    : who can write a program for the following:
    :
    : W = X + Y * 3 if x to value of 6 and Y to 9
    :
    : W = x/4+y * 36y/x x to value of 18 and y to 2

    _______________________________________________________________________

    Hi,

    Are you treating these as two separate problems or
    simultaneous equations?

    VB.Net code>>

    [code]
    Dim x As Integer
    Dim y As Integer
    Dim w As Integer

    For x=1 To 6
    For y=1 to 9

    W = X + Y * 3 'Is this the order you want it in?
    textbox1.AppendText(" W= " & CStr(w))
    textbox1.AppendText(" when x= " & CStr(x))
    textbox1.AppendText(" and y= " & CStr(y) & VBCrLf & VBCrLf)

    Next
    Next
    [/code]

    Is that what you are after?

    For the 2nd equation>>

    VB.Net code>>

    [code]
    Dim x As Double
    Dim y As Double
    Dim w As Double

    For x=1 To 18
    For y=1 to 2

    W =(x/(4+y)) * ((36*y)/x)) 'Is this the order you want it in?
    textbox1.AppendText(" W= " & CStr(w))
    textbox1.AppendText(" when x= " & CStr(x))
    textbox1.AppendText(" and y= " & CStr(y) & VBCrLf & VBCrLf)

    Next
    Next
    [/code]


    Put either section of code in a button click event Sub
    and don't forget to add a textbox with MultiLine property
    set to True and vertical scrollbar property set.

    Download the EXPRESS edition for FREE here>>
    http://msdn.microsoft.com/vstudio/express/vb/


    Regards,

    Dr M.


    P.S. If PIPPIN is the programming language then i'm sorry i've not
    heard of it.

Sign In or Register to comment.