السلام عليكم ورحمة الله وبركاته
اريد شرح مفهوم الاسئله وكيف فكرتها لفهم السؤال
ووو لبدئ محاولة حلي وطرحه
لمساعدتكم اذا كان الجواب صحيح ام لا
شاكره ومقدره لمساعدتكم
الاسئله تشمل موضوع 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!**