تقييم الموضوع :
  • 0 أصوات - بمعدل 0
  • 1
  • 2
  • 3
  • 4
  • 5
[VB.NET] اريد كود للبرنامج التالي بطريقة general procedures
#1
هذا السؤال لمن يستطيع فهمه  Huh


Write a VB program that takes an array as input an integer from the user and displays the maximum and minimum value. This processing must be in a function procedure and the result should be displayed in the event procedure (button click).also you must display even numbers in this array by subroutine procedure.
الرد }}}
تم الشكر بواسطة:
#2
sample TextBox1 text: 2,3,4,5,6,7

(event procedure (button click
PHP كود :
Private Sub Button1_Click(sender As System.ObjectAs System.EventArgsHandles Button1.Click

    Dim splt
() As String Me.TextBox1.Text.Split(",")

 
   Dim arr(splt.Count 1) As Integer
    For i 
0 To splt.Length 1
        arr
(i) = Val(splt(i))
 
   Next


    Label1
.Text GetArrayMaximumValue(arr)

 
   Label2.Text GetArrayMinimumValue(arr)

 
   DisplayArrayEvenNumbers(arr)

End Sub 



function procedure
Maximum
PHP كود :
Function GetArrayMaximumValue(arr As Integer()) As Integer
    Return arr
.Max()
End Function 
OR
PHP كود :
Function GetArrayMaximumValue(arr As Integer()) As Integer
    Dim mx 
As Integer Integer.MinValue
    For i 
0 To arr.Length 1
        If arr
(i) > mx Then
            mx 
arr(i)
 
       End If
 
   Next
    Return mx
End 
Function 



function procedure
Minimum
PHP كود :
Function GetArrayMinimumValue(arr As Integer()) As Integer
    Return arr
.Min()
End Function 
OR
PHP كود :
Function GetArrayMinimumValue(arr As Integer()) As Integer
    Dim mn 
As Integer Integer.MaxValue
    For i 
0 To arr.Length 1
        If arr
(i) < mn Then
            mn 
arr(i)
 
       End If
 
   Next
    Return mn
End 
Function 



display even numbers
subroutine procedure
PHP كود :
Sub DisplayArrayEvenNumbers(arr As Integer())
 
   For i 0 To arr.Length 1
        If arr
(iMod 2 0 Then
            Label3
.Text Label3.Text arr(i) & " "
 
       End If
 
   Next
End Sub 

الرد }}}
تم الشكر بواسطة: a_abdullah
#3
(05-12-16, 01:21 PM)amgad525 كتب : sample TextBox1 text: 2,3,4,5,6,7

(event procedure (button click
PHP كود :
Private Sub Button1_Click(sender As System.ObjectAs System.EventArgsHandles Button1.Click

    Dim splt
() As String Me.TextBox1.Text.Split(",")

 
   Dim arr(splt.Count 1) As Integer
    For i 
0 To splt.Length 1
        arr
(i) = Val(splt(i))
 
   Next


    Label1
.Text GetArrayMaximumValue(arr)

 
   Label2.Text GetArrayMinimumValue(arr)

 
   DisplayArrayEvenNumbers(arr)

End Sub 



function procedure
Maximum
PHP كود :
Function GetArrayMaximumValue(arr As Integer()) As Integer
    Return arr
.Max()
End Function 
OR
PHP كود :
Function GetArrayMaximumValue(arr As Integer()) As Integer
    Dim mx 
As Integer Integer.MinValue
    For i 
0 To arr.Length 1
        If arr
(i) > mx Then
            mx 
arr(i)
 
       End If
 
   Next
    Return mx
End 
Function 



function procedure
Minimum
PHP كود :
Function GetArrayMinimumValue(arr As Integer()) As Integer
    Return arr
.Min()
End Function 
OR
PHP كود :
Function GetArrayMinimumValue(arr As Integer()) As Integer
    Dim mn 
As Integer Integer.MaxValue
    For i 
0 To arr.Length 1
        If arr
(i) < mn Then
            mn 
arr(i)
 
       End If
 
   Next
    Return mn
End 
Function 



display even numbers
subroutine procedure
PHP كود :
Sub DisplayArrayEvenNumbers(arr As Integer())
 
   For i 0 To arr.Length 1
        If arr
(iMod 2 0 Then
            Label3
.Text Label3.Text arr(i) & " "
 
       End If
 
   Next
End Sub 

بس عشان افهم ليش حطيت هنا me 
 Dim splt() As String = Me.TextBox1.Text.Split(",")
الرد }}}
تم الشكر بواسطة:


المواضيع المحتمل أن تكون متشابهة .
الموضوع : الكاتب الردود : المشاهدات : آخر رد
  كيف نستخرج نص الالتاريخ الاول من النص التالي: justforit 0 136 31-10-25, 05:33 PM
آخر رد: justforit
  كيف تصمم واجهات برامجك بطريقة الكبار .. مقدمة في تصميم واجهات المستخدم ali.alfoly 11 7,778 09-10-25, 08:24 AM
آخر رد: مصمم هاوي
  [سؤال] اريد طباعة تقرير ريبورت فيو مباشرة فور عرض التقرير mh66 1 565 22-03-25, 09:59 AM
آخر رد: mh66
  اريد كود لو سمحتم خالد كامل1 10 1,228 15-02-25, 02:15 PM
آخر رد: خالد كامل1
  اريد كود معين اثابكم الله خالد كامل1 1 460 04-02-25, 09:28 PM
آخر رد: aliday03
  اريد كود يحذف جميع سجلات جدول بقاعدة بيانات اكسس دفعه واحده khalidalwdi 2 644 18-11-24, 01:02 AM
آخر رد: rdxdz
  اريد جلب عدد محدد من السجلات من قاعدة بيانات اكسس الى الداتا قراد فيو يوجد مثال khalidalwdi 2 672 12-11-24, 12:19 PM
آخر رد: khalidalwdi
  ما هو الخطأ في كود التعديل التالي صالح عبدالله 6 584 12-10-24, 04:02 PM
آخر رد: صالح عبدالله
  [نقاش] اريد مسااعدة انا مبتدئة ف بحر غارق?? ..N 1 351 29-09-24, 11:16 PM
آخر رد: justforit
Exclamation [VB.NET] اريد كود لتصدير البيانات من DataGridView الى ملف Excel zazasami 1 501 04-08-24, 09:15 PM
آخر رد: mrfenix93

التنقل السريع :


يقوم بقرائة الموضوع: