Giter VIP home page Giter VIP logo

swiftui-cw-6's Introduction

تمرين - 6

BMI Calculator

خطوات

  1. قم بعمل Fork لهذا المجلد و clone وافتح المجلد من خلال Github Desktop
  2. قم بإنشاء مشروعاً جديداً واحفطه في هذا المجلد.
  3. أضف 2xTextField واحد ل weight و واحد ل height
  4. قم بإضافة زر، بحيث إذا تم الضغط على الزر يتم حساب الـ bmi

معادلة ال bmi

bmi = weight / (height * height) 
  1. استعمل الدوال functions لحساب ال bmi وحالة الجسد (متين / طبيعي / نحيف )
bmi calcaultor gif
بونص 🎁
- قم بعرض صور لكل حالة بشكل مختلف 
- إذا أدخل المستخدم رقماً خاطئ - أقل من الصفر أو أعلى من رقم غير معقول، لون الـ TextField باللون الأحمر
- في حال الضغط على الزر وهناك مدخلات خاطئة قم بوضع نص أحمر أسفل الحقول واعرض فيه رسالة الخطأ
هنتات 👀
// This function might help you take a double value for BMI and convert it to a status using Switch statement.
func bmiStatus(bmi: Double) -> String{
    switch bmi {
    case ..<20: return "thin"
    case 20..<25: return "normal"
    case 25...: return "fat"
    default: return ""
    }
}

swiftui-cw-6's People

Contributors

omsi96 avatar mohamad7islam 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.