من

  • مسابقة من سيربح المليونية

    لتضيف خيار المساعدة الخاصة التي تسمح للمستخدم بتخطي الإجابة مرة واحدة فقط، يمكنك استخدام متغير منطقي (boolean) لتتبع ما إذا تم استخدام هذا الخيار أم لا. في البداية، يجب عليك تهيئة هذا المتغير بقيمة “false” للإشارة إلى أن الخيار لم يتم استخدامه بعد. عندما يستخدم المستخدم الخيار، قم بتغيير قيمة المتغير إلى “true” لتمنع استخدامه مرة أخرى.

    هناك طريقتان لتنفيذ ذلك، إما عن طريق إضافة قطعة منطقية (boolean) جديدة تسمى مثل “helpUsed”، أو عن طريق استخدام المتغير a[] بحيث يكون a[15] خاص بتتبع استخدام الخيار. سأستخدم الطريقة الأولى في الشرح التالي:

    cpp
    #include #include using namespace std; int main() { string a[15]; //Array which will take answers string print, print2; //Strings for printing questions ifstream answers("q&a.txt"); bool helpUsed = false; // Variable to track if help option is used cout << "Welcome to who wants to be a millionaire\n"; while (answers) //Read questions from the file { getline(answers, print); auto position = print.find("01."); if (position <= print.size()) { print2 = print.substr(position + 1); cout << print2 << endl << "A. Blackburn Losers\nB. Blackburn Rovers\nC. Blackburn Lovers\nD. BlackburnWanderers\n"; } cin >> a[0]; if (a[0] == "b") //If correct, proceed to next question { getline(answers, print); position = print.find("02."); } else if (a[0] == "help" && !helpUsed) // Check if help option is used and not used before { helpUsed = true; // Set helpUsed to true getline(answers, print); position = print.find("02."); } else { cerr << "We are sorry, you are wrong!\n"; break; } // Continue with the rest of the questions // ... } return 0; }

    في هذا المثال، يتم تعيين المتغير helpUsed إلى false في البداية. عندما يستخدم المستخدم الخيار “help”، يتحقق البرنامج مما إذا تم استخدام الخيار بالفعل (!helpUsed)، وإذا لم يتم استخدامه يتم تعيين helpUsed إلى true ويتم السماح بالمتابعة إلى السؤال التالي.

    المزيد من المعلومات

    لإضافة المزيد من المعلومات إلى برنامجك، يمكنك استخدام متغير إضافي لتتبع ما إذا تم استخدام الخيار المساعد أم لا، وتحديد الإجراءات التي يجب اتخاذها بناءً على ذلك. هناك عدة طرق للقيام بذلك، وإليك مثالًا على كيفية توسيع برنامجك ليدعم المزيد من الإجراءات:

    cpp
    #include #include using namespace std; int main() { string a[15]; //Array which will take answers string print, print2; //Strings for printing questions ifstream answers("q&a.txt"); bool helpUsed = false; // Variable to track if help option is used int currentQuestion = 0; // Variable to track the current question cout << "Welcome to who wants to be a millionaire\n"; while (answers && currentQuestion < 15) //Read questions from the file { getline(answers, print); auto position = print.find("0" + to_string(currentQuestion + 1) + "."); if (position <= print.size()) { print2 = print.substr(position + 1); cout << print2 << endl << "A. Option A\nB. Option B\nC. Option C\nD. Option D\n"; } cin >> a[currentQuestion]; if (a[currentQuestion] == "b") //If correct, proceed to next question { currentQuestion++; } else if (a[currentQuestion] == "help" && !helpUsed) // Check if help option is used and not used before { helpUsed = true; // Set helpUsed to true currentQuestion++; } else { cerr << "We are sorry, you are wrong!\n"; break; } } if (currentQuestion == 15) { cout << "Congratulations!\nYou won a million dollars!\n"; } return 0; }

    هذا المثال يستخدم متغير currentQuestion لتتبع السؤال الحالي، ويحدد السؤال الذي يجب طرحه بناءً على قيمة currentQuestion، كما يضيف الإجراء اللازم عند استخدام الخيار المساعد.

  • SD-WAN الجيل الجديد من

    ال SD-WAN الحالي والذي يعتبر قديم الان  يعتمد في عمله على التفضيل بين الخطوط SD-WAN Tunnels على اساس Layer 3 وما يؤثر عليها من عوامل اهمها

    1-Delay

    2-Jitter

    3- Packet loss

    اما ال SD-WAN الجديد والذي يسمى NG SD-WAN يعتمد في تحديد المسارات والخطوط على اساس حاجة التطبيق Application Needs .

    بمعنى تستطيع ان تحدد اي واحد في الشركة يستخدم مثلا تطبيق Offic 365 يجب ان يستخدم طريق A واي واحد يستخدم تطبيق مثلا Youtube او Google suite يذهب بطريق B

    هنا تحديد المسارات اصبحت على اساس مايحتاجه التطبيق نفسة . اي بمعنى ال SD-WAN الجديد يوفر امكانية تصل الى Layer 7 .

زر الذهاب إلى الأعلى
إغلاق

أنت تستخدم إضافة Adblock

يرجى تعطيل مانع الإعلانات حيث أن موقعنا غير مزعج ولا بأس من عرض الأعلانات لك فهي تعتبر كمصدر دخل لنا و دعم مقدم منك لنا لنستمر في تقديم المحتوى المناسب و المفيد لك فلا تبخل بدعمنا عزيزي الزائر