GithubHelp home page GithubHelp logo

uc-web-cw-5's Introduction

اليوم راح راح نحسب مؤشر وزن الجسم ⚖️!

الجزء الاول

  1. قم بعمل fork للـ repository
  2. افتح الـ repository باستخدام github desktop
  3. افتح ملف script.js وابدأ الحل
  4. عرف دالة BMI تستقبل معاملين (weight, height)
    • استخدم المعادلة التالية لحساب مؤشر وزن الجسم:
      الوزن / (الطول * الطول)
    • ارجع ناتج المعادلة بإستخدام كلمة return
  5. قم بمناداة الدالة داخل console.log ولا تنسى كتابة معاملات
  6. احفظ التغييرات وارفع الكود إلى github

بونص! ✨

  • قم بكتابة معاملات افتراضية للدالة، وكرر الخطوة 5 بدون معاملات!

الجزء الثاني

  1. اكمل الخطوات في ملف script.js
  2. عرف دالة Status تستقبل معامل bmi, وترجع لنا قيمة على المقياس التالي:
returnbmi
"لديك نقص في الوزن"< 18.5
"وزنك صحي">= 18.5 && < 25
"لديك زيادة في الوزن">= 25
  1. إذهب إلى وسم h2 في صفحة HTML واستخدم حدث onclick وقم بإستدعاء الدوال التالية:
    alert(Status(BMI(80, 1.8)))
  2. احفظ اتغيرات وارفع الكود إلى github

بونص! ✨

  • قم بإستخدام حدث onmouseover بدلاً من onclick في الخطوة 3

الجزء الثالث

  1. اكمل الخطوات في ملف script.js
  2. عرف دالة calculate لتعمل الخطوات التالية عند مناداتها:
    • احفظ قيمة الوزن التي في حقل الإدخال في متغير weight
    • احفظ قيمة الطول التي في حقل الادخال في متغير height
    • احسب المؤشر عن طريق دالة BMI واحفظه في متغير bmi
    • مرر قيمة المؤشر إلى دالة Status واحفظ المرجع في متغير desc
    • اعرض قيمة متغير bmi ومتغير desc داخل الوسم الذي يحمل هوية result
  3. اضف حدث onclick إلى الزر ليستدعي دالة calculate
  4. احفظ اتغيرات وارفع الكود إلى github
  5. قم بتسليم التمرين على موقع Mentorly

بونص! ✨

  • قم بالتعبير عن كل حالة من الحالات بتغيير لون النص، مثلا:
    • لديك نقص في الوزن  <- باللون البرتقالي
    • وزنك صحي <- باللون الاخضر
    • لديك زيادة في الوزن <- باللون الاحمر

آخر موعد لرفع الكود هو نهاية المحاضرة "لا تترددون أنكم تسألون المدرسين 👌"

uc-web-cw-5's People

Contributors

waliiidals avatar nkkxiii avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.