- تاريخ التسجيل
- 17 يناير 2010
- المشاركات
- 14,630
- المجموعة
- أنثى
- الدفعة الدراسية
- 2010
- الكلية
- كلية تقنية المعلومات
- التخصص
- Computer science
حتى لو كان الحل حق سؤال خارجي ..![]()
اسئلة خارجية أو اسئلة التتوريال او امتحانات سابقة اوكي
آسفه .. تم استرجاع الرد
حتى لو كان الحل حق سؤال خارجي ..![]()
اسئلة خارجية أو اسئلة التتوريال او امتحانات سابقة اوكي
آسفه .. تم استرجاع الرد


" no problem " <<
المفروض في موضوع فيه قوانين ..![]()
هذا لا شيء ، المشكلة في تطابق الكودلا تحطون الكود للأسايمنت كاااامل عشان جهدكم لا يُقتبس
لكن أعترض على النسخ الأعمى


write function sort that use bubble sort the message according to their size:
void buublesort Email (Email mailBox[], int size);
write function search th that returns true if (T0 person) equals yo "To" in mail box:
bool searchTo(Email mailBox[],int size,string Toperson);
ممكن تشرحولي كيف الحل؟؟؟
؟؟؟؟؟؟؟؟؟؟؟؟؟؟؟؟؟؟
Email temp;
for(int i=0 ; i<size-1 ; i++)
{
for(int j=i+1 ; j<size; j++)
{
int zi,zj;
mailBox[i].getsize(zi);
mailBox[j].getsize(zj);
if(zi>zj)
{
temp=mailBox[i];
mailBox[i]=mailBox[j];
mailBox[j]=temp;
}
}
}
for(int i=0 ; i<size ; i++)
{
string to;
mailBox[i].getTo(to);
if(to==Toperson)
return true;
}
return false;
السؤال الأول :-
طالب ترتيب العناصر حسب الحجم اللي محطوط داخل كل " class "
بنستخدم الدالة " get " إذا كانت موجوده عشان نطلع الحجم من الكلاس .. بعدين نقارن بينهم ونرتبهم
بيكون مثل التالي ..
كود:Email temp; for(int i=0 ; i<size-1 ; i++) { for(int j=i+1 ; j<size; j++) { int zi,zj; mailBox[i].getsize(zi); mailBox[j].getsize(zj); if(zi>zj) { temp=mailBox[i]; mailBox[i]=mailBox[j]; mailBox[j]=temp; } } }
السؤال الثاني :-
نسوي فور لوب وحده .. مثل السؤال اللي قبل نستخدم الدالة " get " عشان نجيب الـ " TO " اللي داخل الكلاس
بعدين نقارنها بـ " Toperson " إذا كانوا متساوين يرجع قيمة " true "
وإذا خلص وما حصل حاجه يرجع قيمة " false "
وهذا مثال ..
كود:for(int i=0 ; i<size ; i++) { string to; mailBox[i].getTo(to); if(to==Toperson) return true; } return false;

(1) Complete the class defined in the previous exercise to include the following functions:
• Withdraw function which is used to withdraw a certain amount X from the Account. It should check that the balance in the account is at least equal to X (ie X or more) before it allows the withdrawal and reduce the Balance by X.
• Deposit which is used to Deposit a certain amount Y into the Account. It should of course increase the Balance by Y.
• IsAccountEmpty which returns true if the Balance is less than or equal to zero. Otherwise it returns false.
(2) Write a main function to test your class as follow:
- Write one statement to define an array named AccountList with size 300 that contains objects of class BankAccount.
- Write statements to print on the screen all the empty Accounts in AccountList (that have a balance of zero or less). Assume that the list length is 100.
السلام عليكم ممكن شرح هذا بتفصيل لو سمحتوووووووووووووووووووووووووووووووووا
بارت 2
* مطلوب اضيفين 3 فنكشنات
الأولى: فنكشن تستخددم عشان تنقص قيمة المبلغ الأصلي من المبلغ الي يتحدد عشان ينسحب
فبتجيك ان في الأكاونت قد المبلغ الي بتسحبه أو أكثر قبل السحب
الثانية: اهني يزيد قيمة المبلغ الموجودة بالمبلغ الي بيدخله صاحب الأكاونت
في الفنكشنتين بنحتاج قيمة السحب أو قيمة الايداع و أتوقع يكونون براميتر
الثالثة: اتجيك الحساب فيه مبلغ او لا
* في المين ديفايند أري حجمه 300 فيه أوبجكت من نوع الكلاس الي عندنا
BankAccount AccountList[300];
بكون في هذا الكلاس كل جزء منه أوبجكت .. الأوبجكت فيه كل القيم الأساسية الي في البرايفت
* بما إن عندنا أري بنحتاج فور لوب
داخله اف ستيتمنت حسب الموجود بالسؤال
اذا اتحقق الشرط بسوي كول فنكشن الى البرنت
تطبع قيم الآي الي تحقق عندها الشرط " الأوبجكت"
AccountList.print();
أي استفسار ثاني حاضرين
و طبعاً الأقواس تعرفون ليهم شلون طريقتهم
بس بالمنتدى يطلعون بهالطريقة ما ادري ليش
احتمال من المتصفح عندي ^^"

(1) Complete the class defined in the previous exercise to include the following functions:
• Withdraw function which is used to withdraw a certain amount X from the Account. It should check that the balance in the account is at least equal to X (ie X or more) before it allows the withdrawal and reduce the Balance by X.
• Deposit which is used to Deposit a certain amount Y into the Account. It should of course increase the Balance by Y.
• IsAccountEmpty which returns true if the Balance is less than or equal to zero. Otherwise it returns false.
(2) Write a main function to test your class as follow:
- Write one statement to define an array named AccountList with size 300 that contains objects of class BankAccount.
- Write statements to print on the screen all the empty Accounts in AccountList (that have a balance of zero or less). Assume that the list length is 100.
السلام عليكم ممكن شرح هذا بتفصيل لو سمحتوووووووووووووووووووووووووووووووووا
بارت 2
* مطلوب اضيفين 3 فنكشنات
الأولى: فنكشن تستخددم عشان تنقص قيمة المبلغ الأصلي من المبلغ الي يتحدد عشان ينسحب
فبتجيك ان في الأكاونت قد المبلغ الي بتسحبه أو أكثر قبل السحب
الثانية: اهني يزيد قيمة المبلغ الموجودة بالمبلغ الي بيدخله صاحب الأكاونت
في الفنكشنتين بنحتاج قيمة السحب أو قيمة الايداع و أتوقع يكونون براميتر
الثالثة: اتجيك الحساب فيه مبلغ او لا
* في المين ديفايند أري حجمه 300 فيه أوبجكت من نوع الكلاس الي عندنا
BankAccount AccountList[300];
بكون في هذا الكلاس كل جزء منه أوبجكت .. الأوبجكت فيه كل القيم الأساسية الي في البرايفت
* بما إن عندنا أري بنحتاج فور لوب
داخله اف ستيتمنت حسب الموجود بالسؤال
اذا اتحقق الشرط بسوي كول فنكشن الى البرنت
تطبع قيم الآي الي تحقق عندها الشرط " الأوبجكت"
AccountList.print();
أي استفسار ثاني حاضرين
و طبعاً الأقواس تعرفون ليهم شلون طريقتهم
بس بالمنتدى يطلعون بهالطريقة ما ادري ليش
احتمال من المتصفح عندي ^^"

(1) Complete the class defined in the previous exercise to include the following functions:
• Withdraw function which is used to withdraw a certain amount X from the Account. It should check that the balance in the account is at least equal to X (ie X or more) before it allows the withdrawal and reduce the Balance by X.
• Deposit which is used to Deposit a certain amount Y into the Account. It should of course increase the Balance by Y.
• IsAccountEmpty which returns true if the Balance is less than or equal to zero. Otherwise it returns false.
(2) Write a main function to test your class as follow:
- Write one statement to define an array named AccountList with size 300 that contains objects of class BankAccount.
- Write statements to print on the screen all the empty Accounts in AccountList (that have a balance of zero or less). Assume that the list length is 100.
السلام عليكم ممكن شرح هذا بتفصيل لو سمحتوووووووووووووووووووووووووووووووووا
for (int i=0;i<100;i++)
{
AccountList[i].get(a,n,b);
if (b<=0)
AccountList[i].DisplayAccountDetails();
}



مجرّد تعريف1- Declare SavingAccounts as an array of 7 objects of BankAccount.
BankAccount SavingAccounts[7];
تاخذ البيانات من ملف "saveings.dat" و تستخدم هذه الأشياء في برنامج- Read the details of SavingAccounts from file ”savings.dat”.
#include<fstream>
int main(){
ifstream inputfile;
inputfile.open("saveings.dat");
inputfile.close();
}
تسوي function ترتب الـ balance من الصغير إلى الكبير- Write a function that uses bubble sort to sort SavingAccounts according to balance.
مجرّد أستدعاء لـ function الـ Display علشان تطلّع كل البيانات من بعدما تم تعديل ترتيب البيانات- Print details of SavingAccounts on screen after sorting.
BankAccount SavingAccounts[7];
void bubblesort (BankAccount list[],int length)

عندي استفسارين :-
1- تتوقعون التست فيه أسئلة فايل ؟ .. لأن ما اتذكر هالدرس من زمان ماخذه 103
2- المخطط للفنكشن او للبرنامج الي نرسمه .. يجيبون مثل هالسؤال ؟ .. على دفعتنا قبل ما فيه هالاختراع

A class called (BankAccount) which has 3 private members ( AccountNumber
(long), Name (string), and Balance (float)
In MAIN program we declared SavingAccounts as an array of 7 objects of BankAccount
The question here is how to write a function that uses bubble sort to sort SavingAccounts according to balance.PHP:BankAccount SavingAccounts[7];
I think the prototype for the function is
PHP:void bubblesort (BankAccount list[],int length)
HELP ME PLZ
BankAccount temp;
for(int i=0 ; i<size-1 ; i++)
{
for(int j=i+1 ; j<size; j++)
{
int zi,zj;
SavingAccounts[i].getbalance(zi);
SavingAccounts[j].getbalance(zj);
if(zi>zj)
{
temp=SavingAccounts[i];
SavingAccounts[i]=SavingAccounts[j];
SavingAccounts[j]=temp;
}
}
}
