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

اسئله في c++ بموضوع arrays

بدأه miss fno في 28 أبريل 2010 · 3 رد · 8,856 مشاهدة · في الأسئلة المجابة
مشاركة: واتساب X فيسبوك تيليجرام
#1 صاحب الموضوع

السلام عليكم ورحمة الله وبركاته

اريد شرح مفهوم الاسئله وكيف فكرتها لفهم السؤال

ووو لبدئ محاولة حلي وطرحه

لمساعدتكم اذا كان الجواب صحيح ام لا

شاكره ومقدره لمساعدتكم

الاسئله تشمل موضوع arrays

استيعابي فيه مو مره وهذا اول تطبيقاتي عليه ياليت يكون شرح واضح بما اني لسى مبدئه فيه وشكرا :)

السؤال الاول:

Write program that deal with array of integers that contains random values,

that's mean you should use rand() function that's generate array's elements. In

your program, you should sort the elements of randomly array. Then print your

array before and after sorting.

Note: sort the array using insertion sort algorithm that is explained

Output sample:-

Array which generated randomly :

-------------------------------

0 3 3 2 9 0 8 2 6 6

-------------------------------

Array's elements after sorted :

-------------------------------

0 0 2 2 3 3 6 6 8 9

-------------------------------

***********************

السؤال الثاني :

Write C++ program that define an array of strings word as following:-

string Fruits ={"apple", "orange" , "banana",

"grape" , "pear" , "strawberry" ,

"berry" , "peach" , "dates" };

Your program should ask user to enter any kind of fruits, then search in your

array to verify if it's in the list or no. Then print one of the following massages

up to the searching result.

Output samples:-

Enter a kind of fruit and I'll

Search in the Fruit's Array!

apple

apple** is in the Fruits list!**

Enter a kind of fruit and I'll

Search in the Fruit's Array!

Bread

Bread ** is not in Fruits list!**

تم تعديل هذه المشاركة بواسطة miss fno في 28 أبريل 2010 في 21:42

سبحانك اللهم وبحمدك لا اله الا انت استغفرك واتوب اليك ‘‘

#2

و عليكم السلام ورحمة الله وبركاته .. ,

miss fno كتب:

السؤال الاول:

Write program that deal with array of integers that contains random values,that's mean you should use rand() function that's generate

array's elements. Inyour program, you should sort the elements of randomly array.

Then print yourarray before and after sorting

.Note: sort the array using insertion sort algorithm that is explained inchapter 7- section 8.

Output sample:-

Array which generated randomly :

-------------------------------0 3 3 2 9 0 8 2 6 6-------------------------------

Array's elements after sorted :

-------------------------------0 0 2 2 3 3 6 6 8 9-------------------------------

فكرة السؤال الأول ,

تعرفين مصفوفة .. بما أنه ما حدد طولها , فيمكنك تحديد طول لها أو تسألين المستخدم كم عدد بتدخل ..

تسوين For و تعبين المصفوفة , قيمها هي قيم عشوائية .. و ذلك بإستخدام الدالة () rand  ..

تطبعين المصفوفة , بعدين ترتبينها و تطبعينها مرة ثانية بعد الترتيب ..

أتمنى يكون وآضح ..

حاولي تكتبين الكود و بسآعدك إن شاء الله ..

بالتوفيق :happy: ..

سبحآن الله وبحمده .. سبحآن الله العظيم .. ,

#3

اهلا اختي اشراقه الف شكر لك لتوضيح وفهمت ماهو المطلوب

لكن كيف داله rand()

من بحثي وجدت انها عباره عن

rand (namr array ,arraysize)

هل هذا مقصودها ؟؟

تم تعديل هذه المشاركة بواسطة miss fno في 29 أبريل 2010 في 08:42

سبحانك اللهم وبحمدك لا اله الا انت استغفرك واتوب اليك ‘‘

#4
miss fno كتب:

لكن كيف داله rand()

من بحثي وجدت انها عباره عن rand (namr array ,arraysize)هل هذا مقصودها ؟؟

مرحبا ,

أنظري إلى ()rand

سبحآن الله وبحمده .. سبحآن الله العظيم .. ,

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