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

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

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

ITCS112 - ITCS104 - ITCS102 للفصل الصيفي 2014 - 2015

Bubble Sort
كود:
void bubbleSort(int list[], int length)
{
    int temp;
    int iteration;
    int index;
 
    for (int i = 1; i < length; i++)
    {
        for (j= 0; j < length - i; j++)
            if (list[j] > list[j + 1]) 
            {
                temp = list[j];
                list[j] = list[j + 1];
                list[j + 1] = temp;
            }
    }
}

اذا مثلا :
عندي arr[5]:20 15 12 22 10
و أبغي أسوي لهم sort ..
المرة الأولى صارت لي
22 10 20 12 15 و بعد أبغي أسوي لهم Sort شلون , الـsort يوقف اذا كل العناصر صارت مرتبة ؟
مو المفترض الـ sort يصير مرة واحدة فقط !
اللي فهمته ان :

​
i=1///////j=0
1
2
3
4

وبهالطريقة قدرت أسوي الـsort , لكن ما عرفت أكمل ..
المفروض في النهاية يصير 22 20 15 12 10
ممكن توضيح ؟

في البوبل سورت يرتب عناصر اللسته كلها

بجيك كل خانتين مع بعض الى ان تترتب اللسته كلها و بعدين بيطلع بره اللوب
:smile2:

جوفي هالرابطين للتوضيح


يوسف حراث :: من سلايد 11 الى سلايد 18
https://www.uob-bh.com/forum/downloads.php?do=file&id=1651


و هالرابط يوضح الطريقة بالتفصيل بس في شي زيادة (flag) اعتبريه مو موجود
http://mathbits.com/mathbits/compsci/arrays/bubble.htm

:smile2:

​
 
  • Like
التفاعلات: Lutos
Calculate the area and the perimeter of valid triangles of array tris and store them in two arrays areaArr and permArr. You have to define these arrays.


شلوون نسوي هذا ؟؟

بلييز احد يعلمني ويفهمني شنو المقصود منه بالضبط ..
 

  • b. [FONT=Times New Roman,Times New Roman]Write a main function which includes the following:[/FONT]
    [FONT=Times New Roman,Times New Roman]- Creates an instance named miniCircle of type Circle with xCenter=1, yCenter=2, and radius=0.5.

    شنو المطلوب في هالخطوة ؟
    instance شلون ؟
    [/FONT]
 
b. Write a main function which includes the following:
- Creates an instance named miniCircle of type Circle with xCenter=1, yCenter=2, and radius=0.5.

شنو المطلوب في هالخطوة ؟
instance شلون ؟

اعتقد تسويين فنكشن ومنها تعرفين دائرة جديده اسمها ميني سيركل وتحطين قيم الاكس والواي والراديوس
 
Problem 2: Write a function named displayAllOccurences that takes as parameters an array of integers, an integer key value, and the array size. The function should search for all occurrences of the key value in the array and display their position in the array, if the value is not found in the array, the function should display a message saying that the value is not found in the array. The function prototype is:

كود:
void displayAllOccurences(int arr[], int key, int size);


حاولت أحل هالسؤال , ممكن تجيكون حلي !
كود:
# include<iostream>
using namespace std;
 void main ()
{
    int key;
    int arr[3]={3,4,5};
    cout<<"enter key to be searched";
    cin>>key;
     displayAlloccurences(arr,5,3);
}

void displayAlloccurences(int arr[],int key,int size);
{
    bool found=false
        for(int i=0;i<size;i++)
            if(arr[i]==key)
                found=true;
    cout<<"Key found at"<<position;
    if (found=false)
        cout<<"Not found";
}

عندي 2 ايرور !
 
السلام عليكم
عندي استفساااار بخصوص الامتحان يوم الأربعاااء
بكون الساعة كم ؟؟
ضروووري اللي يدري يخبرنيي
 
ضروري شنو مواضيع الامتحان ومتى بيكون واي حزه مادري عن شي في المقرر :bleh:
 
اللي يدرسون في سكشن طاهر متاكدين انكم بتنجحون :whistling:
 
كود:
#include <iostream>
using namespace std;
class circle
{
private:
    float xcircle,ycircle,radius;
public:
    circle();
    circle(float=0,float=0,float=0);
    void getcircle (float x,float y, float r);
    void setcircle (float x,float y, float r);
    float CalculateArea (float x,float y);
    float minicircle (float x,float y, float r);

};

circle::circle()
{
    xcircle=0; ycircle=0; radius=0;
}
circle::circle(float x, float y, float r)
{
    xcircle=x; ycircle=y; radius=r;
}
void getcircle (float x,float y, float r)
{
    xcircle=x; ycircle=y; radius=r;
}
void setcircle (float x,float y, float r)
{
    xcircle=x; ycircle=y; radius=r;
}
float area (float x,float y)
{
    float a;
    a=(0.5*x)*y;
    return a;
}

 int main ()
{
    float xcircle,ycircle,radius;


    cout<<"Enter x and y";
    cin>>xcircle>>ycircle;


    circle();
    circl(float=0,float=0,float=0);
    getcircle (float x,float y, float r);
    setcircle (float x,float y, float r);
    CalculateArea (float x,float y);
    minicircle (1,2,0.5)




    return 0;
}

السؤال :-

a.Create a class calledCircle that contains two integer data members named xCenter and yCenter, and a floating point data member named radius. The xCenter and the yCenter values represent the center point of the circle, radius represents the radius of the circle which is a non-negative floating point number.
In addition, the Circle class has the following member functions:
- A constructor function with default values xCenter = 0, yCenter=0, and radius=0.
- Set and get functions for all data members.
- A function named calculateArea that returns the area of the Circle
- A Destructor function.
b. Write a main function which includes the following:
- Creates an instance named miniCircle of type Circle with xCenter=1, yCenter=2, and radius=0.5.
- Write a statement to output the area of miniCircle.

عندي ايرورات


​
 
كود:
#include <iostream>
using namespace std;
class circle
{
private:
    float xcircle,ycircle,radius;
public:
    circle();
    circle(float=0,float=0,float=0);
    void getcircle (float x,float y, float r);
    void setcircle (float x,float y, float r);
    float CalculateArea (float x,float y);
    float minicircle (float x,float y, float r);

};

circle::circle()
{
    xcircle=0; ycircle=0; radius=0;
}
circle::circle(float x, float y, float r)
{
    xcircle=x; ycircle=y; radius=r;
}
void getcircle (float x,float y, float r)
{
    xcircle=x; ycircle=y; radius=r;
}
void setcircle (float x,float y, float r)
{
    xcircle=x; ycircle=y; radius=r;
}
float area (float x,float y)
{
    float a;
    a=(0.5*x)*y;
    return a;
}

 int main ()
{
    float xcircle,ycircle,radius;


    cout<<"Enter x and y";
    cin>>xcircle>>ycircle;


    circle();
    circl(float=0,float=0,float=0);
    getcircle (float x,float y, float r);
    setcircle (float x,float y, float r);
    CalculateArea (float x,float y);
    minicircle (1,2,0.5)




    return 0;
}

السؤال :-

a.Create a class calledCircle that contains two integer data members named xCenter and yCenter, and a floating point data member named radius. The xCenter and the yCenter values represent the center point of the circle, radius represents the radius of the circle which is a non-negative floating point number.
In addition, the Circle class has the following member functions:
- A constructor function with default values xCenter = 0, yCenter=0, and radius=0.
- Set and get functions for all data members.
- A function named calculateArea that returns the area of the Circle
- A Destructor function.
b. Write a main function which includes the following:
- Creates an instance named miniCircle of type Circle with xCenter=1, yCenter=2, and radius=0.5.
- Write a statement to output the area of miniCircle.

عندي ايرورات


​



PHP:
    float xcircle,ycircle,radius;
xcircle,ycircle نوعهم انتجر
PHP:
  circle();
مو مطلوب في السؤال constructor من هالنوع يعني المفروض تمسحين هالجملة


PHP:
  void getcircle (float x,float y, float r);
لازم المتغيرات يكونون رفرنس (لازم تخلين &)


PHP:
  float CalculateArea (float x,float y);
هالفنكشن ما تاخد شي


PHP:
 float minicircle (float x,float y, float r);
من وين جايبه هالفنكشن؟؟؟ امسحيها


PHP:
float area (float x,float y) {
     float a;
     a=(0.5*x)*y; 
    return a; }
هالفنكشن المفروض تصير :

PHP:
float circle::calculateArea(){
    return 3.14*radius*radius;
}



والمين فنكشن ما يحتاج كل هذا , المطلوب جملتين بس!
PHP:
int main(){

    float area;
circle miniCircle;
miniCircle.set(1,2,0.5);
area=miniCircle.calculateArea();
cout<<"area = "<<area;
return 0;
}


ولازم اتضيفين Destructor في الكلاس
PHP:
~circle();


المفروض يختفون الاررات احين :rolleyes2:
 
exam ITCS104

وين راح يكون الاختبار يوم الاربعاء؟
 
والساعة جم؟
 
الساعة 11

في سكاشن

​
 
Static number of class

شنو فكرة هالدرس ؟

اجي بس آوت بوت صح ؟

​
 
بلى ويانه ... اخر درس مطلوب شرحته لنا اوت بوت وماعتقد يجي رايت بروقرام
 
Calculate the area and the perimeter of valid triangles of array tris and store them in two arrays areaArr and permArr. You have to define these arrays.


شلوون نسوي هذا ؟؟

بلييز احد يعلمني ويفهمني شنو المقصود منه بالضبط ..

:99: مثل سؤال أختي :RpS_crying:
محد يرد:RpS_crying: :99:
 
شصار في التست :whistling:​
 
عودة
أعلى أسفل