NewStats: 3,265,387 , 8,186,575 topics. Date: Saturday, 14 June 2025 at 05:53 PM 3w4j616382y |
programmers Please Help A Friend on visual basic. (1627 Views)
(1) (Go Down)
Immanuelar(m): 5:10am On Aug 24, 2013 |
Please help me out of this problem. I want to write a program that generates odd and even number within a particular range that is to be entered by the in visual basic . That's i will have 2 textbox,one for the smaller and one for the highest. I have used several loop statement in other to generate either the odd or even number but to no avail .you can help with the algorithms in any prog language and I will write the program. Thanks
|
slikcipher(m): 7:27am On Aug 24, 2013 |
Immanuelar: Please help me out of this problem. I want to write a program that generates odd and even number within a particular range that is to be entered by the in visual basic . That's i will have 2 textbox,one for the smaller and one for the highest. I have used several loop statement in other to generate either the odd or even number but to no avail .you can help with the algorithms in any prog language and I will write the program. Thanks Send me a mail...... [email protected] |
Immanuelar(m): 11:55am On Aug 24, 2013 |
someone please help me. you may give me only the algorithms and I will write the program myself.
|
Immanuelar(m): 11:55am On Aug 24, 2013 |
slikcipher: I have sent a mail. |
jboy01(m): 1:43pm On Aug 24, 2013 |
Immanuelar: someone please help me. you may give me only the algorithms and I will write the program myself.am a vb.net guy, am not with my system now, you can add me on whatsapp so dat we can talk more on it 08061249343 |
Immanuelar(m): 6:31pm On Aug 24, 2013 |
Nobody is gonna help me ![]() ![]() ![]() |
jboy01(m): 6:10pm On Aug 25, 2013 |
Immanuelar: Nobody is gonna help meis the program going to print the even digit separatly from the odd? |
ade77ade(m): 10:27pm On Aug 25, 2013 |
very simple all you do is 1 validate to check is the values in the text box is numerical or empty 2 use modulo function to check the digits in the text-boxes (determines if its even or odd number) 3 declare two variables that will hold for odd numbers and even numbers 4 a set a counter to increment whatever the first text-box hold (by 1 is odd) b set a counter to increment whatever the first text-box hold (by 1 is even) 5 loop in the counters 6 exit the loop if the result from the variable is equal to or greater than text box 2 |
Immanuelar(m): 5:01am On Aug 26, 2013 |
jboy01:yeah it's going to print it. |
Immanuelar(m): 5:24am On Aug 26, 2013 |
ade77ade: very simple all you do isdo u mean something like this? Priv sub command1 cclick dim x, y ,counter as integer x= val(text1.text) y,=val(text2.text) if x>y then msgbox "incorrect" If ((x mod 2)=0) then Counter =x+1 debug.print counter do until counter =val(text2.text) loop else if ((x mod 2)<>0) then counter =x+1 do until counter =val(text2.text) loop end if debug.print counter end sub Please help me check the code and tell me where am wrong. Thanks |
jboy01(m): 7:30am On Aug 26, 2013 |
Immanuelar: Please help me out of this problem. I want to write a program that generates odd and even number within a particular range that is to be entered by the in visual basic . That's i will have 2 textbox,one for the smaller and one for the highest. I have used several loop statement in other to generate either the odd or even number but to no avail .you can help with the algorithms in any prog language and I will write the program. ThanksSorry bro, i saw ur post yesterday but i was have headache, that was why i was unable to attend to it yesterday. but i think this will be helpful. Public Class Form1 ' 'Since the program is to get both the even and odd number between two values, 'then the progaram is divided in to two subroutine. '(1) The even subroutine :- Gets the even numbers between the two inputs '(2) The odd subroutine :- Gets the odd numbers between the two inputs ' Private Sub even() 'The even sub Dim startnum As Integer = CInt(TextBox1.Text) Dim endnum As Integer = CInt(TextBox2.Text) - 2 Dim even As Integer If startnum Mod 2 = 1 Then startnum = startnum - 1 even = startnum While even < endnum even = even + 2 System.Console.WriteLine("even : " & even) End While Else even = startnum While even < endnum even = even + 2 System.Console.WriteLine("even : " & even) End While End If End Sub Private Sub odd() 'The odd sub Dim startnum As Integer = CInt(TextBox1.Text) Dim endnum As Integer = CInt(TextBox2.Text) - 2 Dim odd As Integer If startnum Mod 2 = 1 Then odd = startnum While odd < endnum odd = odd + 2 System.Console.WriteLine("odd : " & odd) End While Else odd = startnum + 1 While odd < endnum odd = odd + 2 System.Console.WriteLine("odd : " & odd) End While End If End Sub Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim startnum As Integer = CInt(TextBox1.Text) Dim endnum As Integer = CInt(TextBox2.Text) If startnum > endnum Then MsgBox("Incorrect input, The first input must be less than the Second input" ![]() Else Call even() 'Calling the even() subroutine Call odd() 'Calling the odd() subroutine End If End Sub End Class |
Immanuelar(m): 9:04am On Aug 26, 2013 |
jboy01: thanks. will reshape the code to visual basic 6 and test it. thanks |
(1) (Reply)
Ponzi Website Script For Sale With Free Installation
(Go Up)
Sections: How To . 29 Disclaimer: Every Nairaland member is solely responsible for anything that he/she posts or s on Nairaland. |