خدمات البرمجة ---- أطلب أي مساعدة في البرمجة - ملتقى الشفاء الإسلامي

 

اخر عشرة مواضيع :         أثر المتصوفة (اخر مشاركة : ابوالوليد المسلم - عددالردود : 0 - عددالزوار : 2 )           »          عدم رضا النبي ﷺ عن الجدال: الحديث بكل الروايات الصحيحة (اخر مشاركة : ابوالوليد المسلم - عددالردود : 0 - عددالزوار : 4 )           »          من ذاق حب الله ارتوى (اخر مشاركة : ابوالوليد المسلم - عددالردود : 0 - عددالزوار : 3 )           »          بيان كثرة طرق الخير (اخر مشاركة : ابوالوليد المسلم - عددالردود : 0 - عددالزوار : 3 )           »          الحمدُ انفعالُ الحبّ (اخر مشاركة : ابوالوليد المسلم - عددالردود : 0 - عددالزوار : 4 )           »          الاجتماع القلبي قبل الاتفاق الفكري (اخر مشاركة : ابوالوليد المسلم - عددالردود : 0 - عددالزوار : 3 )           »          شجاعة الاعتذار (اخر مشاركة : ابوالوليد المسلم - عددالردود : 0 - عددالزوار : 11 )           »          الإسـراء والمعـراج (اخر مشاركة : ابوالوليد المسلم - عددالردود : 0 - عددالزوار : 5 )           »          عافية النسيان (اخر مشاركة : ابوالوليد المسلم - عددالردود : 0 - عددالزوار : 4 )           »          أخطر اللصوص من يسرق الثواب (اخر مشاركة : ابوالوليد المسلم - عددالردود : 0 - عددالزوار : 4 )           »         

العودة   ملتقى الشفاء الإسلامي > قسم الصوتيات والمرئيات والبرامج > ملتقى البرامج والانترنات والجرافيكس
التسجيل التعليمـــات التقويم

ملتقى البرامج والانترنات والجرافيكس كل ما يختص بالكمبيوتر والانترنات من برامج ومعلومات وخدمات مجانية

 
 
أدوات الموضوع انواع عرض الموضوع
Prev المشاركة السابقة   المشاركة التالية Next
  #17  
قديم 17-03-2009, 10:59 PM
zaynubya zaynubya غير متصل
عضو مبدع
 
تاريخ التسجيل: Oct 2007
الجنس :
المشاركات: 893
افتراضي رد: خدمات البرمجة ---- أطلب أي مساعدة في البرمجة

****** Oriented Programming


Write a program to carry out manipulation on sets. Create a class called set with two private members, the elements of the set and the size of the set. The elements should be an array of integers to hold an appropriate number of elements (e.g. 20). Provide a default constructor to initialize a newly defined set to be the empty set, the size of which should be zero. Provide also three utility functions to add, remove and to print elements of a set.

Provide for class set that you have developed member functions to implement the following operations on sets using appropriate member functions:
a) Determine the union of two sets and store the result in a third set;
b) Determine the intersection of two sets and store the result in a third set;
c) To test if a given set is the empty set;
d) To test if one set is included in another set.


Hint:
The class should have data members an array of integers of a large size (for ex 20) and N= number of elements in the set.
As you first create the set, N=0 (set by the constructor)

The add function should add one element to the set. and not add two sets.
void set::add(set &S, int x) will make x an element of the set S.

for example, if S1 is still the empty set, and we call function add to add element 2 to S1, then S1 becomes:
S1 = {2}, N=1.
To add element 3:
S1={2,3}, N=2
To remove element 2,
S1={3}, N=1
therefore to remove an element, in the implementation of that function, we search the array to see if that element exists, and then if found, you have to slide the remaining elements back one position (i.e. no empty spots should exist in the array.)


A utility function is a member function that can return a set. But you don't need the add function to return a set. Whereas the union and intersection functions may return the resulting set.

If you really need a function (get or set) you can add it and justify its need in the comments.

__________________
بالصبر تبلغ ما ترجوه من أمل *** فاصبر فلا ضيق إلا بعده فرج




رد مع اقتباس
 


الذين يشاهدون محتوى الموضوع الآن : 1 ( الأعضاء 0 والزوار 1)
 

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

BB code is متاحة
كود [IMG] متاحة
كود HTML معطلة

الانتقال السريع


 


الاحد 20 من مارس 2011 , الساعة الان 01:21:21 صباحاً.

Powered by vBulletin V3.8.5. Copyright © 2005 - 2013, By Ali Madkour

[حجم الصفحة الأصلي: 332.34 كيلو بايت... الحجم بعد الضغط 330.62 كيلو بايت... تم توفير 1.73 كيلو بايت...بمعدل (0.52%)]