Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / NewStats: 3,149,958 members, 7,806,775 topics. Date: Tuesday, 23 April 2024 at 11:31 PM |
Nairaland Forum / Science/Technology / Programming / programmers Please Help A Friend on visual basic. (1566 Views)
Help Needed Urgently On Visual Basic. Experts Please! / Need Help On Visual Basic. / Tutorials And Websites To Learn More On Visual Basic (2) (3) (4)
programmers Please Help A Friend on visual basic. by 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 user 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 |
Re: programmers Please Help A Friend on visual basic. by 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 user 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...... Slikcipher@gmail.com |
Re: programmers Please Help A Friend on visual basic. by 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. |
Re: programmers Please Help A Friend on visual basic. by Immanuelar(m): 11:55am On Aug 24, 2013 |
slikcipher: I have sent a mail. |
Re: programmers Please Help A Friend on visual basic. by 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 |
Re: programmers Please Help A Friend on visual basic. by Immanuelar(m): 6:31pm On Aug 24, 2013 |
Nobody is gonna help me |
Re: programmers Please Help A Friend on visual basic. by 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? |
Re: programmers Please Help A Friend on visual basic. by 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 |
Re: programmers Please Help A Friend on visual basic. by Immanuelar(m): 5:01am On Aug 26, 2013 |
jboy01:yeah it's going to print it. |
Re: programmers Please Help A Friend on visual basic. by 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 |
Re: programmers Please Help A Friend on visual basic. by 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 user 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 |
Re: programmers Please Help A Friend on visual basic. by Immanuelar(m): 9:04am On Aug 26, 2013 |
jboy01: thanks. will reshape the code to visual basic 6 and test it. thanks |
(1) (Reply)
Why Are The Nairaland Programmers Still Using Html 4 Coding...... / Pls I Need Your Help Concerning My Assignment 2 (database) / Nigerian Tech Whizkid CHRIS KWEKOWE Reveals Why He Turned Down Bill Gate's Offer
(Go Up)
Sections: politics (1) business autos (1) jobs (1) career education (1) romance computers phones travel sports fashion health religion celebs tv-movies music-radio literature webmasters programming techmarket Links: (1) (2) (3) (4) (5) (6) (7) (8) (9) (10) Nairaland - Copyright © 2005 - 2024 Oluwaseun Osewa. All rights reserved. See How To Advertise. 42 |