الفريق العربي للبرمجةأرشيف المنتديات · 2000 – 2023
نسخة أرشيفية للقراءة فقط — التسجيل والمشاركة مغلقان، والمحتوى محفوظ كما كان.

جديد في موقعكم وفي عالم البرمجة

مغلق
بدأه Tahtooh في 25 ديسمبر 2004 · 1 رد · 474 مشاهدة · في Microsoft Visual Basic.NET
مشاركة: واتساب X فيسبوك تيليجرام
#1 صاحب الموضوع

أخوكم طه من لبنان جديد على موقعكم

ومبتدأ في عالم البرمجة سنة أولى "نظم المعلوماتية"

وصلني إعلان هذا الموقع بالبريد الالكتروني فاهتممت جدًا للموقع

والآن عندي شغف في قراءة وتصفح مقالاتكم المهمة والاستفادة منها

ولكن في الوقت الحالي أعاني من مشكلة

وقصتي تتلخص في كود لبرنامج مطلوب مني للجامعة

كتبته على الconsole application

لكن الأستاذ طلب منا أن نعيد صياغته على الwindows application

إلى يوم الاثنين المقبل

والمشكلة أنني تغيبت عن الحصة التي شرح فيها الwindows application __016

وإلى الآن لم أتوصل إلى برنامج ويندوز مع أنني أنفقت وقتًا طويلاً في القراءة والتجربة

في الواقع أنا خجل من نفسي، ولكن من كان عنده وقت كي يساعدني فسأدعو له في ظهر الغيب لأنه سينقذني من المأساة 001

وجزى الله خيرًا كل من يحاول المساعدة __027

#2

هذا هو الكود

والبرنامج يستخدم صيغة random لاختبار المستعمل في جدول الضرب

أرجو أن لا يكون الموضوع سخيفًا جدًا ومملاً لكم

Module Multiplication

Dim rand As Random = New Random()

Dim product As Integer

Dim repeat As Integer

Dim Z As Integer

Dim x As Integer = rand.Next(10)

Dim y As Integer = rand.Next(10)

Dim name As String

Dim countTrue As Integer = 0

Dim countFalse As Integer = 0

Dim sumCount As Integer

Dim condition As Integer

Dim choice As String

Sub Main()

Console.WriteLine(vbTab & vbTab & "This program is designed by TAHTOOH ")

Console.WriteLine(vbTab & vbTab & "It helps you to test your multiplication skills" & vbCrLf)

Console.WriteLine()

Console.Write("What is your name? ")

name = Console.ReadLine

If name = "ziad" Then

condition += 1

Console.WriteLine("Welcome Mr. " & name & "!!" & vbCrLf & "TAHTOOH hopes that you enjoy this program")

Console.WriteLine("TAHTOOH also hopes that you appreciate his work, and put 10/10")

Console.WriteLine("Please!!")

Else

Console.WriteLine("Welcome " & name & "!!" & vbCrLf & "TAHTOOH hopes that you enjoy this program")

End If

Console.WriteLine()

Console.WriteLine("Please answer (Enter -1 to stop)")

x = rand.Next(10)

y = rand.Next(10)

Console.Write(x & " * " & y & " = ")

product = Console.ReadLine()

Console.WriteLine()

step1(product)

sumCount = countTrue + countFalse

Dim score As Double = (countTrue / sumCount) * 100

Console.WriteLine()

Console.WriteLine(vbTab & vbTab & name & ", You answered " & sumCount & " question(s)")

Console.WriteLine(vbTab & vbTab & countTrue & " True answer(s)")

Console.WriteLine(vbTab & vbTab & countFalse & " False answer(s)")

Console.WriteLine(vbTab & vbTab & "Your Score is: " & Math.Ceiling(score) & " %")

Console.ReadLine()

If condition = 1 Then

Console.Write("Do you agree to put 10/10 (y/n) ?? ")

choice = Console.ReadLine()

If choice = "y" Then

Console.WriteLine("TAHTOOH thanks you very much.. MWAH!!")

Console.ReadLine()

Else

Do While choice <> "y"

Console.WriteLine("Sorry the program can't understand your choice")

Console.WriteLine("It will ask without sentinal exit till you agree")

Console.WriteLine()

Console.Write("Do you agree to put 10/10 (y/n) ??")

choice = Console.ReadLine()

Loop

If choice = "y" Then

Console.WriteLine("TAHTOOH thanks you very much.. MWAH!!")

End If

Console.ReadLine()

End If

End If

End Sub

Sub step1(ByRef product As Integer)

While product <> -1

Z = x * y

If product = Z Then

Console.WriteLine()

T(product)

Else

repeat = 0

While repeat <> 2

Z = x * y

Console.WriteLine()

F(product)

Console.Write(x & " * " & y & " = ")

product = Console.ReadLine()

If product = Z Then

Console.WriteLine()

T(product)

Exit While

Else

repeat += 1

End If

End While

End If

If repeat = 2 Then

If product <> Z Then

Console.WriteLine("Don't worry; we will skip this question")

Exit While

End If

End If

Console.WriteLine()

step2(product)

End While

Console.WriteLine()

step2(product)

End Sub

Sub step2(ByRef product As Integer)

While product <> -1

Console.WriteLine()

Console.WriteLine("Please answer (-1 to stop)")

x = rand.Next(10)

y = rand.Next(10)

Console.Write(x & " * " & y & " = ")

product = Console.ReadLine()

Console.WriteLine()

step1(product)

End While

End Sub

Sub T(ByRef t As Integer)

countTrue += 1

Dim rand As Random = New Random()

Dim any As Integer = rand.Next(4)

If any = 0 Then

Console.WriteLine("Very Good")

ElseIf any = 1 Then

Console.WriteLine("Excellent")

ElseIf any = 2 Then

Console.WriteLine("Bravo")

ElseIf any = 3 Then

Console.WriteLine("Nice Work")

End If

End Sub

Sub F(ByRef f As Integer)

countFalse += 1

Dim rand As Random = New Random()

Dim any As Integer = rand.Next(3)

If any = 0 Then

Console.WriteLine("No; please try again")

ElseIf any = 1 Then

Console.WriteLine("You can do better; try again")

ElseIf any = 2 Then

Console.WriteLine("Wrong answer; take another chance")

End If

End Sub

End Module

هذا الموضوع مغلق.

مواضيع مشابهة