النتائج 1 إلى 6 من 6

الموضوع: طلب مساعده بحل الاسئله التاليه.

  1. #1
    عضوية جديدة
    تاريخ التسجيل
    Jul 2009
    المشاركات
    4
    معدل تقييم المستوى
    0

    Lightbulb طلب مساعده بحل الاسئله التاليه.

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



    Question 1

    Write a program to simulate hand-held electronic calculator. Your program should execute as follows:

    • Step 1: display a prompt and wait for the user to enter an instruction code (a single character):
    ‘+’ for addition
    ‘-‘ for subtraction
    ‘*’ for multiplication
    ‘/’ for division
    ‘p’ for power
    ‘c’ to clear the current accumulator
    ‘s’ for square root
    ‘l’ for log
    ‘n’ for ln
    ‘q’ for quit
    • Step 2: (if needed) display a prompt and wait for the user to enter a type float number (which we will call left-operand)
    • Step 3: (if needed) display a prompt and wait for the user to enter a type float number (which we will call right-operand)
    • Step 4: display the accumulated result at any point during processing and repeat steps 1 through 3 using a GOTO statement (no loops in this assignment).

    Use a separate function enter_code to prompt the user for instruction code and to ensure that a valid code is entered. Also, use a separate function enter_operand for the entry of the left-operand and the right-operand. Finally, use another function compute to perform the indicated operation. (unless q was entered).




    Question 3
    A Baby Sitting Problem: A baby sitter charges $1.50 per hour until 9:00 pm (while the kids are still up), $1.00 per hour between 9:00 pm and midnight, and $1.25 per hour after midnight (since late night baby sitting interferes with morning classes).
    Write a program that reads the sitter's starting time in hours and minutes and the ending time in hours and minutes and then computes the sitter's fee. Assume all times are between 6:00 pm and 6:00 am; hours should be entered as numbers on a 12-hour clock, so that hour 3 should be considered as 3:00 am and hour 8 should be considered as 8:00 pm. Hours outside the range 1 to 12 should be considered invalid.
    [Note: You may not use a 24 hour clock for this problem. Also, times must be given in hours and minutes (as two nonnegative integer values).]

    Question 4
    Write a program to get a date from the user in the format day/month/year. Tip: use extra variables to read the /. The program should check the three parts of the date (day, month, year), and print a warning message for any part of the date that is wrong. If the whole date is correct, it should print a message saying that the date is valid. The normal rules for dates apply: valid days are from 1 to 28, 29, 30, or 31 (depending on the month and on whether the year is a leap year. You might want to use a switch statement to perform this task.); valid months are from 1 to 12; valid years start from 1582 (the year in which our current calendar system started). The rule for deciding if a year is a leap year is as follows: a year evenly divisible by 4 is a leap year; except if the year is evenly divisible by 100, in which case it is not a leap year; except if the year is evenly divisible by 400, in which case it is a leap year.

    Examples:

    ./date_check
    Enter a date (d/m/y): 29/2/2002
    The day 29 is not valid!


    ./date_check
    Enter a date (d/m/y): 32/15/1002
    The year 1002 is not valid!
    The month 15 is not valid!
    The day 32 is not valid!


    ./date_check
    Enter a date (d/m/y): 20/9/2002
    The given date is valid.

  2. #2
    عضو برونزي الصورة الرمزية rezoufda
    تاريخ التسجيل
    Jun 2007
    المشاركات
    3,180
    الدولة: Morocco
    معدل تقييم المستوى
    23

    رد: افيدوني افادكم الله

    اهلا وسهلا بك اختي بيننا، وحظا موفقا في الدراسة

    القسم المناسب لطلبك هذا هو قسم البرمجة، هناك تضمنين أكبر كم من الاجابات من ذوي الاختصاص
    على العموم كمحاولة مني لمساعدتك في ما يخص السؤال الأول، أقترح الرابط، ومراجعة المواضيع الواردة به
    https://www.google.co.ma/search?hl=a...D8%AB%21&meta=

    وفقنا الله وإياك
    [CENTER][COLOR="#000000"][B]اللهم اغفر للمؤمنين والمؤمنات الأحياء منهم والأموات إنك سميع مجيب الدعوات[/B][/COLOR][/CENTER]
    [B][COLOR="YellowGreen"][CENTER][url]www.rasoulallah.net[/url][/CENTER][/COLOR][/B]

    [CENTER][SIZE="4"]ت.م/ رضا - المغرب
    [/SIZE][/CENTER]
    [CENTER][SIGPIC][/SIGPIC][/CENTER]
    [CENTER]آخر [COLOR="#000000"][/COLOR]مواضيعي:

    [URL="https://www.arabhardware.net/forum/showthread.php?p=1153286#post1153286"][SIZE="2"][B]روتر Wigate الجديد، لمشاركة الـ 3G[/B][/SIZE][/URL]

    [URL="https://www.arabhardware.net/forum/showthread.php?p=960990#post960990"][SIZE="2"][B]كل ما تود معرفته عن معالج intel Atom[/B]
    [/SIZE][/URL]

    [/CENTER]

  3. #3
    عضوية جديدة
    تاريخ التسجيل
    Jul 2009
    المشاركات
    4
    معدل تقييم المستوى
    0

    رد: افيدوني افادكم الله

    مشكور اخوي جزاك الله خير تسلم ماقصرت

  4. #4
    عضو الصورة الرمزية koky5500
    تاريخ التسجيل
    Jan 2009
    المشاركات
    173
    الدولة: Egypt
    معدل تقييم المستوى
    0

    رد: افيدوني افادكم الله

    السؤال الرابع
    CPP / C++ / C Code:
    كود PHP:
    class Date()
    {
    private:
        
    int day,month,year;//the current date.
    public:

        
    Date(int d,int m,int y)
        {
            
    day=d;
            
    month=m;
            
    year=y;//the current day..
            
    }

    void setDate()
    {
        
    int d_birth,m_birth,y_birth;//date of birth..
        
    cout<<"enter ur birth day:";
        
    cin>>d_birth;

        if (
    d_birth<|| d_birth>30)
            
    cout<<"enter ur birth day agin please:";
        
    cout<<"enter ur birth month:";
        
    cin>>m_birth;

        if (
    m_birth<|| d_birth>12)
            
    cout<<"enter ur birth month agin please:";

        
    cout<<"enter ur birth year:";
        
    cin>>y_birth;

    }

    string getDate()
    {
    // i dont know how to convert from int to string :(
    }


    }; 
    الحل الاخر :

    كود PHP:
    #include <iostream>
    #include <Cstring>

    using namespace std;



    class 
    Date
    {
       private:
        
    int day,month,year;//the current date.
       
    public:

           
    int d_birth,m_birth,y_birth;//date of birth..

        
    Date(int d,int m,int y)
        {
            
    day=d;
            
    month=m;
            
    year=y;//the current day..
        
    }

    void setDate()
    {
        
    cout<<"enter ur birth day:";
        
    cin>>d_birth;

        if (
    d_birth<|| d_birth>30)
            
    cout<<"enter ur birth day agin please:";
        
    cout<<"enter ur birth month:";
        
    cin>>m_birth;

        if (
    m_birth<|| d_birth>12)
            
    cout<<"enter ur birth month agin please:";

        
    cout<<"enter ur birth year:";
        
    cin>>y_birth;

    }


    string getDate()

      
    char cString[64] = "";
       
      
    sprintf(cString,"%02d-%02d-%04d",month,day,year);
      return 
    string(cString);
    }

    void nextDay()
    {
        

        if (
    day>=30)
        {
            
    day=1;
              
    month++;
        }
        else
            
    day++;

        if (
    month>12)
        {
            
    month=1;
            
    year++;
        }

        
    cout<<day<<"-"<<month<<"-"<<year;
    }

    void print()
    {

        if (
    day<10)
           
    cout<<"0"<<day;
        if (
    month<10)
            
    cout<<"0"<<month;

        
    cout<<day<<"-"<<month<<"-"<<year;

    }

    void age()
    {

        
    int age=0,d_dif,m_dif,y_dif,d_m_dif,d_y_dif;

        
    d_dif=day d_birth;
        
    m_dif=month m_birth;
        
    y_dif=year y_birth;

        
    d_m_dif=m_dif*30;
        
    d_y_dif=y_dif*360;

        
    age=d_dif d_m_dif d_y_dif;

        
    cout<<age;

    }


    };

    int main()

        
    Date currnt(26,10,2007);
        
    int s;

        do
        {
        
    cout<<endl<<"Menu:"<<endl;
        
    cout<<"1-Set Date"<<endl;
        
    cout<<"2-Get string format"<<endl;
        
    cout<<"3-Print the next day"<<endl;
        
    cout<<"4-Print the birth day in the format dd-mm-yyyy"<<endl;
        
    cout<<"5-Calculate age"<<endl;
        
    cout<<"choose One of this menu or '-1' to exit:"<<endl;
        
    cin>>s;



        switch(
    s)
        {
        case 
    1:
            
    currnt.setDate();
            break;

        case 
    2:
            
    currnt.getDate();
            break;

        case 
    3:
            
    currnt.nextDay();
            break;

        case 
    4:
            
    currnt.print();
            break;

        case 
    5:
            
    currnt.age();
            break;

        case -
    1:
            break;

        }
        }while (
    != -1);

        return 
    0;


  5. #5
    عضو الصورة الرمزية koky5500
    تاريخ التسجيل
    Jan 2009
    المشاركات
    173
    الدولة: Egypt
    معدل تقييم المستوى
    0

    رد: افيدوني افادكم الله

    وهذا موقع لحلول امثلة C++ ان شاء الله فيه افادة ليكم
    https://www.gidforums.com/f-28.html

  6. #6
    عضوية جديدة
    تاريخ التسجيل
    Jul 2009
    المشاركات
    4
    معدل تقييم المستوى
    0

    رد: طلب مساعده بحل الاسئله التاليه.

    مشكور اخ كوكي مشكور وجزاك الله خير ماقصرت

المواضيع المتشابهه

  1. رايكم بالقطع التاليه؟؟
    بواسطة 3ez في المنتدى الأرشيف
    مشاركات: 3
    آخر مشاركة: 06-02-2013, 19:08
  2. مساعده في اختيار شاشه مناسبه بالمواصفات التاليه
    بواسطة Tariq Elmasry في المنتدى الأرشيف
    مشاركات: 3
    آخر مشاركة: 07-09-2011, 13:50
  3. مساعده فى اختيار موبايل بالمواصفات التاليه
    بواسطة zoro779 في المنتدى الأرشيف
    مشاركات: 4
    آخر مشاركة: 22-07-2011, 19:40
  4. مشاركات: 5
    آخر مشاركة: 11-12-2004, 10:06

الكلمات الدلالية لهذا الموضوع

المفضلات

ضوابط المشاركة

  • لا تستطيع إضافة مواضيع جديدة
  • لا تستطيع الرد على المواضيع
  • لا تستطيع إرفاق ملفات
  • لا تستطيع تعديل مشاركاتك
  •