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

التعقد من حل سؤالين o.o

بدأه Some 0ne في 28 ديسمبر 2011 · 2 رد · 315 مشاهدة · في الأسئلة المجابة
مشاركة: واتساب X فيسبوك تيليجرام
#2

وﻻ تعقد نفسك وﻻ شئ هذة أجابة السؤال اﻻول: أى رقم 4

#include <iostream>
using namespace std;

int main()
{
    double timefun ;
    cout << "Enter fund time: ";
    cin >> timefun;

    if(timefun >= 5 )
        cout << "Interest Rate: 40% for: " << timefun << endl;

    else if(timefun < 5 && timefun >= 4 )
        cout << "Interest Rate: 35% for: " << timefun << endl;

    else if(timefun < 4 && timefun >= 3 )
        cout << "Interest Rate: 30% for: " << timefun << endl;

    else if(timefun < 3 && timefun >= 2 )
        cout << "Interest Rate: 25% for: " << timefun << endl;

    else if(timefun < 2 && timefun >= 1 )
        cout << "Interest Rate: 20% for: " << timefun << endl;
        else if(timefun < 1 )
        cout << "Interest Rate: 15% for: " << timefun << endl;

    return 0;
}

وهذا لسؤال الثانى فقط محتاج منك القليل من المجهود تتبع طريقة وسوف تكمل التمرين بنجاج ان شاء الله ...

#include <iostream>
using namespace std;

int main()
{
    int year = 0, weight = 0;
    cout << "Enter Car's year: ";
    cin >> year;

    cout << "Enter Car's weight: ";
    cin >> weight;

    /// 1990
    if( year < 1991)
    {
        if(weight < 2700 )
            cout << "weight calss : 1 and reg fees: 26.50 " <<  endl;
        else if( weight > 2699 && weight < 3801 )
            cout << "weight calss : 2 and reg fees: 35.50 " <<  endl;
        else if( weight > 3800 )
            cout << "weight calss : 3 and reg fees: 56.50 " <<  endl;
    }
    /// 1991 to 1999
    else if( year < 1990 && year < 2000)
    {
        // same code above ...
    }
    // greater than 2000
    else if( year> 1999)
    {
        // same code above ...
    }

    return 0;
}

تحياتى العطرة والله الموفق.... .

تم تعديل هذه المشاركة بواسطة محمد ابوزايد في 29 ديسمبر 2011 في 14:58

post-15367-027053900%201340345097.gifpost-15367-087183200%201340344597.gif
post-247365-0-10080400-1379403554_thumb.

#3
محمد ابوزايد كتب:

وﻻ تعقد نفسك وﻻ شئ هذة أجابة السؤال اﻻول: أى رقم 4

#include <iostream>
using namespace std;

int main()
{
    double timefun ;
    cout << "Enter fund time: ";
    cin >> timefun;

    if(timefun >= 5 )
        cout << "Interest Rate: 40% for: " << timefun << endl;

    else if(timefun < 5 && timefun >= 4 )
        cout << "Interest Rate: 35% for: " << timefun << endl;

    else if(timefun < 4 && timefun >= 3 )
        cout << "Interest Rate: 30% for: " << timefun << endl;

    else if(timefun < 3 && timefun >= 2 )
        cout << "Interest Rate: 25% for: " << timefun << endl;

    else if(timefun < 2 && timefun >= 1 )
        cout << "Interest Rate: 20% for: " << timefun << endl;
        else if(timefun < 1 )
        cout << "Interest Rate: 15% for: " << timefun << endl;

    return 0;
}

وهذا لسؤال الثانى فقط محتاج منك القليل من المجهود تتبع طريقة وسوف تكمل التمرين بنجاج ان شاء الله ...

#include <iostream>
using namespace std;

int main()
{
    int year = 0, weight = 0;
    cout << "Enter Car's year: ";
    cin >> year;

    cout << "Enter Car's weight: ";
    cin >> weight;

    /// 1990
    if( year < 1991)
    {
        if(weight < 2700 )
            cout << "weight calss : 1 and reg fees: 26.50 " <<  endl;
        else if( weight > 2699 && weight < 3801 )
            cout << "weight calss : 2 and reg fees: 35.50 " <<  endl;
        else if( weight > 3800 )
            cout << "weight calss : 3 and reg fees: 56.50 " <<  endl;
    }
    /// 1991 to 1999
    else if( year < 1990 && year < 2000)
    {
        // same code above ...
    }
    // greater than 2000
    else if( year> 1999)
    {
        // same code above ...
    }

    return 0;
}

تحياتى العطرة والله الموفق.... .

تسلم اخوي بارك الله فيك ^^

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