• 0
  • مالي خلق
  • أتهاوش
  • متضايق
  • مريض
  • مستانس
  • مستغرب
  • مشتط
  • أسولف
  • مغرم
  • معصب
  • منحرج
  • آكل
  • ابكي
  • ارقص
  • اصلي
  • استهبل
  • اضحك
  • اضحك  2
  • تعجبني
  • بضبطلك
  • رايق
  • زعلان
  • عبقري
  • نايم
  • طبيعي
  • كشخة
  • النتائج 1 إلى 2 من 2

    الموضوع: بليز ..... برنامج c++ طالبتكم طلبه

    1. #1
      التسجيل
      15-12-2006
      المشاركات
      2
      المواضيع
      1
      شكر / اعجاب مشاركة

      Exclamation بليز ..... برنامج c++ طالبتكم طلبه

      السلام عليكم ..............

      عندي برنامج سي بلس بلس بليز ساعدوني فيه .........

      Write a C++ program that uses a dynamic array (i.e. use New and Delete build-in functions) to hold a list of students. Each student should have: name, ID, and age.
      Your program should have the following functions:
      • Insert: Insert all students.
      • Print: Print all students.
      • Search: Scan through this array to find all students with particular age.
      • Increment: Add an integer value to each student's ID.

      Important Note: Do not use the index to access array element.

      n لاحظواا انه طالب الحل ب Structures:

      ياليت تردون علي بدري بيليييييييييييييييييييييييييييييييز

      انا حليت وهذا حلي .........

      #include <iostream>
      using namespace std;

      typedef struct student_record {
      int id;
      char name;
      int age;
      }student;
      void insert(student *ptr,int num)
      {
      for (int i=0;i<num;++i){
      cout<<"Enter information for student"<<i+1<<":\n";
      cout<<"Enter the id:\n"; cin>>ptr[i]->id;
      cout<<"Enter the name:\n"; cin>>ptr[i->.name;
      cout<<"Enter the age:\n"; cin>>ptr[i]->age;
      }
      }
      void print(employee *ptr,int num)
      {

      cout<<"The list is:\n";
      for (int i=0;i<num;++i)
      { cout<<"ID:"<<ptr[i->.id;
      cout<<",Name:"<<ptr[i]->name;
      cout<<"\n";
      }

      }
      Void Search (student *ptr,int num)
      {int key;
      for (int i=0;i<num;++i)
      if key=age
      cout<<"ID:"<<ptr[i->.id;
      cout<<",Name:"<<ptr[i]->name;
      cout<<"\n";
      }
      Void in crement (student *ptr,int num)الداله هذي ماعرفتها
      int main()
      {
      int num;
      student *ptr;

      cout<<"please,Enter the number of the student :\n";
      cin>>num;
      ptr=new student[num];
      if (!ptr)
      {
      cout<<"Allocation Failure\n";
      return 1;
      }
      insert(ptr,num);
      print(ptr,num);
      Search(ptr,num)
      Increment(ptr,num)
      delete [] ptr;
      return 0;
      }

      ال main بيحتوي على سوتش كيف اوظفها



    2. #2
      التسجيل
      15-02-2007
      المشاركات
      298
      المواضيع
      58
      شكر / اعجاب مشاركة

      Thumbs up رد: بليز ..... برنامج c++ طالبتكم طلبه

      هذا هو البرنامج الذي قمت أنت بكتابته خال من الأخطاء جربيه وأي مساعدة أخرى أنا جاهز

      #include <iostream>
      using namespace std;
      typedef struct student_record
      {
      int id;
      char name;
      int age;
      }
      student;
      void insert(student *ptr,int num)
      {
      for (int i=0;i<num;++i)
      {

      cout<<"Enter information for student"<<i+1<<":\n";
      cout<<"Enter the id:\n";
      cin>>ptr[i].id;
      cout<<"Enter the name:\n";
      cin>>ptr[i].name;
      cout<<"Enter the age:\n";
      cin>>ptr[i].age;
      }
      }
      typedef struct employee_record
      {
      int id;
      char name;

      }
      employee;
      void print(employee *ptr ,int num)
      {
      cout<<"The list is:\n";
      for (int i=0;i<num;++i)
      {

      cout<<"ID:"<<ptr[i].id;
      cout<<",Name:"<<ptr[i].name;
      cout<<"\n";
      }
      }

      void Search (student *ptr,int num)
      {
      int key;
      for (int i=0;i<num;++i)
      if ( key == ptr[i].age )
      cout<<"ID:"<<ptr[i].id;
      cout<<",Name:"<<ptr[i].name;
      cout<<"\n";
      }
      // void increment (student *ptr,int num) ;

      int main()
      {
      int num;
      student *ptr;
      employee *ptr1 ;
      cout<<"please,Enter the number of the student :\n";
      cin>>num;
      ptr=new student[num];
      if (!ptr)
      {
      cout<<"Allocation Failure\n";
      return 1;
      }
      insert(ptr,num);
      print(ptr1,num);
      Search(ptr,num);
      // Increment(ptr,num);
      delete [] ptr;
      return 0;
      }

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

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