#### Howdy, Stranger!

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

#### 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 Programmers 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 it's exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

# PIPPIN

Posts: 3Member
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

· ·

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