عرض مشاركة مفردة
 
  #1  
قديم 04-12-2009, 07:35 PM
سلام11 سلام11 غير متصل
عضو
 
تاريخ التسجيل: Nov 2009
مشاركة: 3
مستوى تقييم العضوية: 0
سلام11 is on a distinguished road
الافتراضي سؤال بالبرمجة الله يجزاكم خير

السلام عليكم ورحمة الله وبركاته..
الله يعطيكم العافية هذا سؤال وأتمنى ألاقي الحل عندكم...
A Bank wants keep all accounts for each customer; that is, one customer can have
more than one accounts and therefore balances (you do not know how many accounts he/she
may has. Each customer has unique identifier (ID) which is generated automatically and once

established it can’t be modified
.
Bank specifies that if the balance is more than or equal 20.000 SR then its type is
golden and if it’s more than 5000 SR then its type is silver, otherwise it is a bronze account.
1- Complete the following code
2- Use non class member function which takes objects as argument to compare two
accounts and return customer ID that has more accounts. [note that this function
can access private data members of the class directly


.................................................. .................................................. ................

#


include <iostream>
using namespace std;
class Account{
double Balance;
public


:
double getBalance(){return Balance


;}
void setBalance(double balance){Balance = balance}}
int specifyType)(
{


//Complete
It should return 3 for golden, 2 for silver, 1 for
bronze}
void print(){cout<<"Balance Amount: "<<Balance<<"\n


};"
};
//=============================
class BankCustomer{
//Write a composite object here
int numberOfAccounts;
public:
BankCustomer(int numberOfAccounts); //Set Balance for each bank
account
~BankCustomer();
void print(); //Make this function call Account print function
);
//=============================
int main()
{
//Complete
return 0;
{