موقع طلبة جامعة البحرين

يمكنك تصفح الموقع كزائر ولكن ندعوك لتسجيل عضوية خاصة بك لتحصل على كافة الصلاحيات مثل تنزيل ملفات المكتبة وقراءة تعليقات هيئة التدريس وغيرها. يمكنك الحصول على عضوية مجانية بالضغط على زر تسجيل. إذا قمت بالتسجيل مسبقا فيمكنك الضغط على زر دخول.

تسجيل دخول
  • قسم المكتبة الجامعية مغلق مؤقتا بعد الاستهداف التي تعرضت له بعض خدمات أمازون في البحرين، جاري استرجاع الملفات ونقلها إلى سيرفرات جديدة وسيتم بعدها اعادة افتتاح المكتبة

ITCS103 -CSC103-ITCS111-ITCS101 للدراسة و المناقشة الجماعيه 2014-2015

ما هو رأيك في الحصة و بشكل عام ( الشرح - المواضيع -الأسلوب )؟

  • سيئ ، لم أفهم شيئا .

    الأصوات: 9 28.1%
  • جيد ، فهمت نص و نص .

    الأصوات: 10 31.3%
  • ممتاز ، واضح و مقبول .

    الأصوات: 13 40.6%

  • مجموع المصوتين
    32
كود:
void displayPattern(int n){

int y;


for (int i = 1; i<= n ; i++ ){


y= i;
for ( int j = 1; j <= i ; j++){
cout<<y--;
}
cout<<endl;
}


}

}
^
هاي بس الـ Function حسب ما مطلوب في السؤال ..

وهذا الفنكشن وي الـ main عشان اذا تبين تجربينه ..

كود:
#include <iostream>
using namespace std;


void displayPattern(int n);


int main () {




int n ;
cin>>n;
displayPattern(n);




system ("pause");
return 0;
}


void displayPattern(int n){


int y;


for (int i = 1; i<= n ; i++ ){


y= i;
for ( int j = 1; j <= i ; j++){
cout<<y--;
}
cout<<endl;
}


}

هو صار بس لازم الواحد كلهم ورا بعض يعني مايطلع نفس الشكل
 
السؤال يمبون جدي

[FONT=&amp] 1[/FONT]

[FONT=&amp] 21[/FONT]
[FONT=&amp] 321[/FONT]
[FONT=&amp] 4321[/FONT]
[FONT=&amp]54321[/FONT]
 

Write the function void displayPattern(int n) to display a pattern as follows:
[FONT=&amp]1[/FONT]​
[FONT=&amp] 21[/FONT]​
[FONT=&amp] 321[/FONT]​
[FONT=&amp]…[/FONT]​
[FONT=&amp]n n-1……….321 [/FONT]​
for example when n equals to 5 the function displays:​
[FONT=&amp] 1[/FONT]
​
[FONT=&amp] 21[/FONT]​
[FONT=&amp] 321[/FONT]​
[FONT=&amp] 4321[/FONT]​
[FONT=&amp]54321[/FONT]​

​

كود:
 void displayPattern(int n)
 {
	 for (int i=1;i<=n;i++){
		 for (int j=i;j>0;j--)
			 cout<<j;
	 cout<<endl;}
 }
 
السؤال يمبون جدي

[FONT=&amp] 1[/FONT]

[FONT=&amp] 21[/FONT]
[FONT=&amp] 321[/FONT]
[FONT=&amp] 4321[/FONT]
[FONT=&amp]54321[/FONT]

كود:
void displayPattern(int n){





for (int i = 1; i<= n ; i++ ){




for ( int j = 1; j <= i ; j++){
cout<<j;
}
cout<<endl;
}


}
جربي هذا الفنكشن ... :th:
 
هو صار بس لازم الواحد كلهم ورا بعض يعني مايطلع نفس الشكل

انا لأن كان طالع عندي جدي:
759783913.jpg


فسويته بناءا على الي طالع لي :smile2:
 
ممكن مساعدة في حل هذا السؤال

www.gulfup.com
[/URL][/IMG]
 
ممكن مساعدة في حل هذا السؤال

المطلوب فنكشن تاخذ 2D array تجمع كل سطر وتقارن الأيام وتطلع صاحب اكبر يوم وفي اي اسبوع بس :smile2:

كود:
void generateReport(int figures [][7],int row)
 {
	 int max=0,day,week;
	 cout<<"\nWeek\tRainfall data\tTotal"<<endl;
	 for (int i=0;i<row;i++)
	 {
		 int sum=0;
		 cout<<i+1<<"\t";
		 for (int j=0;j<7;j++)
		 {
			 sum+=figures[i][j];
			 if (max<figures[i][j])
			 {max=figures[i][j];day=j+1;week=i+1;}
			 cout<<figures[i][j]<<" ";
		 }
		 cout<<"\t"<<sum<<endl;
	 }
	 cout<<"\nThe wettest day was day "<<day<<" in week "<<week<<endl; 
}
 
المطلوب فنكشن تاخذ 2D array تجمع كل سطر وتقارن الأيام وتطلع صاحب اكبر يوم وفي اي اسبوع بس :smile2:

كود:
void generateReport(int figures [][7],int row)
 {
     int max=0,day,week;
     cout<<"\nWeek\tRainfall data\tTotal"<<endl;
     for (int i=0;i<row;i++)
     {
         int sum=0;
         cout<<i+1<<"\t";
         for (int j=0;j<7;j++)
         {
             sum+=figures[i][j];
             if (max<figures[i][j])
             {max=figures[i][j];day=j+1;week=i+1;}
             cout<<figures[i][j]<<" ";
         }
         cout<<"\t"<<sum<<endl;
     }
     cout<<"\nThe wettest day was day "<<day<<" in week "<<week<<endl; 
}

شكراً جزيلاً يعطيك العافيه :msn-wink:
 
اسئلة بالـ ++C!! ساعدوني

مسا الخير والسرور والفرح والمسرات
كيفكم ان شاء الله منحيين....:blush-anim-cl:




عندي اسئلة ساعدوني فيهن


السؤال الاول


#include <iostream>
void declareArray()
{
int a[3] = {5,2,9}; //explicit initialization
for(int i=0;i<3;i++)
{
cout<<a<< " ";
}
}
int main()
{
declareArray();
return 0;
}
Rewrite the program above without function:




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




#include <iostream>
void dowhile()
{
char ch='a'; //START
do
{
cout<<ch<<" ";
ch++; //STEP
}while(ch<='z'); //STOP
}
int main()
{
dowhile();
return 0;
}
Change the code to while loop







بليز ابي الحل لانه مضمون بالامتحان:tears::tears::tears::tears::tears::tears:

 
التعديل الأخير بواسطة المشرف:
بالسؤال الثاني الكود مكرر مرتين سوري:RpS_love:
 
اجابات الأسئلة حسب فهمي و اعتقادي بتكون كالآتي

1- بدل ما الكود في فنكشن .. بكون في المين مباشرة .. فبينحط نفسه في المين .. بس بدون البروتوتايب و بدون الكول فنكشن

2- do فنكشن مثل while .. الفرق اهني الأمر اكون قبل الوايل
فنفهمها افعل هالأمر while اذا صار هالشرط
فاذا بنحولها الى وايل بنشيل do
و بنحط الأوامر داخل الوايل لوب

الشرح عالسريع, اتمنى يكون واضح . بالتوفيق
 
سلام عليكم
بغيت مساعدة في حل هذا السؤال يمبونه نحله بال array
Consider an existing file named cars.txt containing unknown number of lines. Each line contains information about one car as follows: color (char), model (string), year (integer), price (double). Color may be: R for red, B for blue, W for white, and G for green; model may be: Honda, Toyota, Ford, BMW. Write a program that reads the contents of the file cars.txt into 4 parallel arrays, calculate and displays the averages price of all cars, and then displays cars information whose price is less than the average price of all cars. In addition, the program should find the model which has the most cars with price below average. Assume that the maximum number of lines in the input file is 100.
ضروري :RpS_crying::RpS_crying:
 
سلام عليكم
بغيت مساعدة في حل هذا السؤال يمبونه نحله بال array
Consider an existing file named cars.txt containing unknown number of lines. Each line contains information about one car as follows: color (char), model (string), year (integer), price (double). Color may be: R for red, B for blue, W for white, and G for green; model may be: Honda, Toyota, Ford, BMW. Write a program that reads the contents of the file cars.txt into 4 parallel arrays, calculate and displays the averages price of all cars, and then displays cars information whose price is less than the average price of all cars. In addition, the program should find the model which has the most cars with price below average. Assume that the maximum number of lines in the input file is 100.
ضروري :RpS_crying::RpS_crying:

في حل سابق لمثل السؤال ..:smile2:
​https://www.uob-bh.com/forum/showthread.php?t=29541&p=666557&viewfull=1#post666557
 
وما طلع ليي فايل؟؟
 
قصدي احنا نسوي الفايل نكتب فيه مواصفات جم سيارة؟؟
 
استفسار بليز ساعدوني ؟.؟؟

Write a C++ program that asks the user to enter 12 temperatures for each month in the year and store them in a one-dimensional array called “temps”.
The program should find and print the average temperature of TEN months after excluding the months with the maximum and the minimum temperatures.

Your program should run as follows:
clip_image001.gif


Enter temperature for month 1: 35
Enter temperature for month 2: 40
Enter temperature for month 3: 45
Enter temperature for month 4: 48
Enter temperature for month 5: 46
Enter temperature for month 6: 42
Enter temperature for month 7: 38
Enter temperature for month 8: 37
Enter temperature for month 9: 36
Enter temperature for month 10: 32
Enter temperature for month 11: 33
Enter temperature for month 12: 34

Average Temperature = 38.6
Press any key to continue…
 
عودة
أعلى أسفل