تقييم الموضوع :
  • 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(",")
الرد }}}
تم الشكر بواسطة:


المواضيع المحتمل أن تكون متشابهة .
الموضوع : الكاتب الردود : المشاهدات : آخر رد
  ممكن حل المشكلة فى الكود التالي - من مشاركة استاذنا القدير / عبدالله الدوسري new_programer 4 169 02-03-24, 07:36 PM
آخر رد: new_programer
  زر التالي داتاجريدفيور annagui 0 164 31-01-24, 04:53 PM
آخر رد: annagui
  اريد طباعة الباركود المحدد فقط مع الكمية new_programer 5 430 09-01-24, 08:40 PM
آخر رد: new_programer
  اريد مساعدة في العملية الحسابية melad2002 3 406 29-12-23, 09:10 PM
آخر رد: melad2002
  [كود] اريد كود إرسال البيانات من الفيجوال بيسك إلىPDF issamsaidd 10 5,829 25-12-23, 06:30 PM
آخر رد: الحزين اليماني
  [VB.NET] اريد تعديل في الكود عند طباعة DGV abu_hisham7 1 431 03-12-23, 02:40 AM
آخر رد: abu_hisham7
  [VB.NET] مشكلة المقاسات للبرنامج h2551996 0 300 28-11-23, 04:37 PM
آخر رد: h2551996
  [سؤال] اريد تغيير اسم حقل ضمن جدول بقاعدة بيانات اكسس mh66 1 358 08-11-23, 08:16 AM
آخر رد: justforit
  كيف اجعل البرنامج في بداية الشهر ينفذ حدث معين بالاصح اريد البرنامج في تاريخ واحد من Adel27213 3 484 05-11-23, 01:45 AM
آخر رد: justforit
Star [كود] اريد تزويد 45 دقيقة على DateTimePicker1 كل ضغطة Button Ameenh 1 347 01-09-23, 07:13 AM
آخر رد: Asem2

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


يقوم بقرائة الموضوع: بالاضافة الى ( 1 ) ضيف كريم