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

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

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

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

اللهم صل على محمد و آل محمد

ماجا على بالي
:RpS_unsure:

يصير تخلي الحل بشوف اخطائي :nosweat: ؟

اللهم صل على محمد و آل محمد
​
تفضلي سسترتي sabeel

HTML:
#include<iostream>
#include<cmath>
using namespace std;
class sparePart{
public:   
     void setspare(double , double );    
    void getspare( double , double);  
      void procTime(double ,double );  
       void costspare(double ,double );    
    void printspare( );  
       sparePart();   
     ~sparePart();
private:
double area;
double circumference;};

// constructor
sparePart ::sparePart(){
    cout<<"Object has been created"<<endl;}

//destructor
sparePart ::~sparePart(){
    cout<<"Object has been deleted";}

// set function
void  sparePart::setspare(double a, double c){
a=area;
c=circumference;}

// get function
void sparePart::getspare(double a, double c){    a=area;    c=circumference;}

//processing time
void sparePart ::procTime(double a, double c){
double t1;
double t2;
double time;
t1=(area)/3;
t2=(circumference)/2;
time=t1+t2;
cout<<time;}

//cost
 void sparePart::costspare(double a, double c){  

  double costs;
double t1;
double t2;
double time;
t1=(area)/3;
t2=(circumference)/2;
time=t1+t2;
    costs=3.2*time;
    cout<<costs;}
//print

void sparePart ::printspare( ){
    cout<<"Area= "<<area<<"  "<<"circumference"<<circumference;
}

//main

int main(){
sparePart spare[10];
double x;
double y;

for(int i=0;i<10;i++){    cin>>x>>y;spare[i].setspare(x,y);cout<<endl;
}

for(int i=0;i<10;i++){spare[i].getspare(x,y);
cout<<endl;
cout<<"The processing time =";
spare[i].procTime(x,y);
cout<<endl;
cout<<" The cost = ";spare[i].costspare(x,y);}
cout<<endl;
system("pause");return 0;}

:smile2:​
 
مرحبا

ممكن احد يشرح الاوفر لودينق

دكتورتنه مرضت ووهقتنه

جابوا لنا الاربعا وحده مسكينه تحاول تشرح بس مافهمت :RpS_crying:
 
^
^
شكرآآ ..

،،،،

وش سالفة الاسايمنت ..؟ مافهمته ..؟

Assignment#8 (Answer two only)
a- Write a recursive C++ function named squares that takes an integer value n as a parameter and returns the sum of squares of all numbers: 12 + 22 + 32+... +n2 the prototype of the function is: int squares (int n)
b- Write a function called PrintEvenDigit that calls a function to input an integer and display its even digits in reverse order. For example, if you have an integer with a value 5982, you want the even integers to be displayed of that number , such as : 28. Do not enter the integer as a string. You must enter it as an integer.
c- Write a recursive function ReplaceVowel that accepts as parameter a string passed by reference. The function should replace all vowel letters with ‘*’.
Test the functions by writing a C++ program.

اللي ويانا في السكشن وش قالت لكم مالت اللاب امس عنه ؟

صعب :RpS_crying:
 
^
^
شكرآآ ..

،،،،

وش سالفة الاسايمنت ..؟ مافهمته ..؟

Assignment#8 (Answer two only)
a- Write a recursive C++ function named squares that takes an integer value n as a parameter and returns the sum of squares of all numbers: 12 + 22 + 32+... +n2 the prototype of the function is: int squares (int n)
b- Write a function called PrintEvenDigit that calls a function to input an integer and display its even digits in reverse order. For example, if you have an integer with a value 5982, you want the even integers to be displayed of that number , such as : 28. Do not enter the integer as a string. You must enter it as an integer.
c- Write a recursive function ReplaceVowel that accepts as parameter a string passed by reference. The function should replace all vowel letters with ‘*’.
Test the functions by writing a C++ program.

اللي ويانا في السكشن وش قالت لكم مالت اللاب امس عنه ؟

صعب :RpS_crying:
انا ماحضرت الاثنين متى تسليم الاسايمنت
 
^
التسليم بكرآ الليل 9
 
^
^
شكرآآ ..

،،،،

وش سالفة الاسايمنت ..؟ مافهمته ..؟

Assignment#8 (Answer two only)
a- Write a recursive C++ function named squares that takes an integer value n as a parameter and returns the sum of squares of all numbers: 12 + 22 + 32+... +n2 the prototype of the function is: int squares (int n)
b- Write a function called PrintEvenDigit that calls a function to input an integer and display its even digits in reverse order. For example, if you have an integer with a value 5982, you want the even integers to be displayed of that number , such as : 28. Do not enter the integer as a string. You must enter it as an integer.
c- Write a recursive function ReplaceVowel that accepts as parameter a string passed by reference. The function should replace all vowel letters with ‘*’.
Test the functions by writing a C++ program.

اللي ويانا في السكشن وش قالت لكم مالت اللاب امس عنه ؟

صعب :RpS_crying:

اول واحد تسوين فنكشن تاخذ رقم والمفروض الفنكشن ترجع مجموع مربع الارقام من 1 الى الرقم اللي دخله اليوزر << طبعا الفنكشن recursive

في اسئله الريكيرسف اسال روح وين بوقف انا عني رقم مثلا 5 ولازم اجمع الارقام من 5 الى 1 فبوقف عند 1
if( n == 1 ) return 1 * 1;
واذا ما كان واحد برجع مربع العدد + مبع العدد اللي قبله
return n * n + square ( n -1 ) ;


السؤال الثاني فنكشن تطبع الارقام الزوجيه في العدد ونلاحظ انه بطبعم بالمقلوب داخل الفنكشن بقسم العدد واذا بقسم يعني بوقف لما اكمل من تقسيم العدد يعني لما اوصل الى صفر
if( n == 0 ) return ;
الفنكشن نوعها فويد علشان جدي بسوي ريترن بدون قيمه قدامها واذا ما كان صفر باخذ الباقي ع 10 وبجيك اذا زوجي بطبعه واذا مو زوجي ما بسوي له شي

int r = n % 10;
if( r %2 == 0 ) cout<< r;
وعقب بسوي كول الى الفنكشن مره ثانيه بس بحذف اخر رقم من العدد
printEvenDigits( n / 10 );

واذا نبي نطبع الارقام بنفس الترتيب اول شي اسوي الكول الى الفكشن عقب اسوي برنت

السؤال الثالث
فنكشن تبدل حروف العله
اذا كانت الفنكشن تاخذ براميتر واحد وهو السترنغ بس
المفروض داخل الفنكشن تجيكين حرف واحد بس نقدر نعرف طول السترنغ فنجيك اذا طول السترنغ = صفر بوقف

if( str.length() == 0 ) return ;
واذا ما كان صفر بجيك حرف واحد < نعرف مكان اخر حرف اللي يسواي length - 1 او مكان اول واحد اللي يساوي 0 >
if(str[0] =='a' || str[0] =='A' ... ونحط باقي الحروف
str[0] = '*';

عقب اسوي كول الى الفنكشن بس احذف الحرف اللي جيكته منها يعني ببدي من 2 حرف
ReplaceVowel ( str.substr(1 ) );
 
طلاب دكتور ميادة سكشن 4
اذ ماعليكم امر احد يقدر يقول لأي درس وصلتون لان صار ليي اسبوع غايب مدري اذ احد يقدر يخبرني اذ ماعليكم امر:nosweat:
 
وصلنا للجبتر الاخير ..

وحلينا التتوريال

وعندنا كوزين يووم الاثنين في الريكورجن والاوفير لودينق ..
 
وصلنا للجبتر الاخير ..

وحلينا التتوريال

وعندنا كوزين يووم الاثنين في الريكورجن والاوفير لودينق ..

شكرا اختي انين الروح على الرد
:RpS_crying: شكلها الدكتورة بسرعة ماشية في الشرح اشلون اللحين بفهم الدروس

احد يقدر يصور ليي النوت ويطرشه
 
int fact(int n)
{if(n==0)return1;
else
return n*fact(n-)
}
cout<<fact()
 
int fact(int n)
{if(n==0)return1;
else
return n*fact(n-1)
}
cout<<fact(3)

اعرف اهني من الفنكشن كل حين انشوفها = الصفر لو لا !
اتصير جذي

return 3*fact(2)
return 2*fact(1)
return 1*fact(0)

بس شنو الاوت بوت يكون اشلون نتعامل معاهم ؟

اتمنى اتساعدوني لان باجر عليي كويز :sad_1:
 
بنات شباب
تتيوريل#6 الـRecursion
بروبلم 5 فيه احد حله !!:nosweat:
إذآ عندكم الحل :blushing:
ماعليكم امر ابغييه :99:
:blush-anim-cl:
 
اعرف اهني من الفنكشن كل حين انشوفها = الصفر لو لا !
اتصير جذي

return 3*fact(2)
return 2*fact(1)
return 1*fact(0)

بس شنو الاوت بوت يكون اشلون نتعامل معاهم ؟

اتمنى اتساعدوني لان باجر عليي كويز :sad_1:

fact 0 بيكون الجواب 1 له ؟
ناخذه ونضربه في 1 الرقم اللي قبله

الناتج مالهم هو fact 1 ناخذ الناتج ونضربه في 2

الناتج مالهم بيكون fact 2 ناخذه ونضربه في 3
 
بعد عندي جم سؤال !!

يعني لما انطلع الاوت بوت انطلعه من النهائي الى البداية ؟

fact(0) هي عبارة عن واحد
fact(1)هي عبارة عن واحد
fact(2)هي عبارة عن 2
 
ما فهمت سؤالش :RpS_unsure:
 
اهني لما يكون عندنا قيمة اكس 6 وقيمة واي 3

if(x>y)
{
cout<<x<<y<<endl;
return f(y-1,x-1)+x*y;}

if(y>=x)
{cout<<x<<y<<endl;
returnf(x%y,y/2);
}


بيكون الاوت بوت

3 6
5 2
2 1
0 1
20

القيمة النهائية تطلع 20 من وين ؟؟

والا بلون احمر هذا ويش سالفته ما استخدمناه >> +x*y

سامحونا
:RpS_unsure:
 
عودة
أعلى أسفل