المساعد الشخصي الرقمي

مشاهدة النسخة كاملة : sequence مافهمتها ممكن أحد يشرح ؟ (++C)



IT Girl
08-10-2004, 09:14 PM
السلام عليكم ورحمة الله وبركاته






أنا مابي حل أبي تحليل أبي أحد يقولي وش المطلوب من هذا السؤال وش الاساسيات فيه وكيف اقوم بعمل الـ sequence





واكون شاكره لكم ولكم خالص الدعاء






Develop a sequence class that holds a sequence of items of type string


The sequence is represented by an array of strings, in addition to the number of items currently in the sequence.


Provide the following methods





1. A constructor that creates an empty sequence


2. A Boolean function full that will test if the sequence cannot store any more item.


3. A function size that will return the current number of items in the sequence.


4. A function Append that will append a given string at the end of the sequence.


5. A function this_string that will return a reference to the item at a given position k.


6. A destructor function that will free the allocated memory .





Create a main function to test your sequence class.


1. Read in words one per line until a sentinel is reached.


2. Replace first letter of each word with capital letter . ex : replace a with A .


3. Print the sequence and its size.


:أفكر:

حسـن
11-10-2004, 10:56 AM
ليست شيئا معينا .. هي كما يقول السؤال.

سلسلة من الـ strings .. عليك تمثيلها في class

ahmedphil
11-10-2004, 08:33 PM
السلام عليكم ورحمة الله وبركاته








أنا مابي حل أبي تحليل أبي أحد يقولي وش المطلوب من هذا السؤال وش الاساسيات فيه وكيف اقوم بعمل الـ sequence



واكون شاكره لكم ولكم خالص الدعاء





Develop a sequence class that holds a sequence of items of type string


The sequence is represented by an array of strings, in addition to the number of items currently in the sequence.


Provide the following methods





1. A constructor that creates an empty sequence


2. A Boolean function full that will test if the sequence cannot store any more item.


3. A function size that will return the current number of items in the sequence.


4. A function Append that will append a given string at the end of the sequence.


5. A function this_string that will return a reference to the item at a given position k.


6. A destructor function that will free the allocated memory .





Create a main function to test your sequence class.


1. Read in words one per line until a sentinel is reached.


2. Replace first letter of each word with capital letter . ex : replace a with A .


3. Print the sequence and its size.


:أفكر:




المطلوب هو برنامج يحتوي على class واحد , الغاية من البرنامج هي طباعة جملة و النعديل عليها هذه الكلمة هي عبارة عن array of strings تكون عضو في ال class ال class كالعادة يحتوي على constructor و destructor و يحتوي على functions هي :
size : حيث يقوم بتحديد عدد الاحرف المخزنة في ال array
Append : حيث يقوم باضافة عنصر معين (حرف) لل array التي هي عبارة عن جملة
this : حيث يقوم بتحديد موقع العنصر في ال array
full : حيث يقوم بفحص ما اذا تجاوز النص حجم ال array المقرر

بعدها المطلوب عمل main function خارج الكلاس حيث يقوم ب

1. تبديل الحرف الاول من كل كلمة ب upper case letter اي حرف كبير
2. قراءة الجملة و التوقف عند الرمز المخصص للتوقف ...ليكن $ مثلا
3.طباعة الجملة كاملة المخزنة في ال array

مع تحياتي