الفريق العربي للبرمجةأرشيف المنتديات · 2000 – 2023
نسخة أرشيفية للقراءة فقط — التسجيل والمشاركة مغلقان، والمحتوى محفوظ كما كان.

ارجو المساعده في حل السؤال

بدأه jmela ahmad في 17 يونيو 2011 · 5 رد · 389 مشاهدة · في الأسئلة المجابة
مشاركة: واتساب X فيسبوك تيليجرام
#1 صاحب الموضوع

ارجو ان تساعدوني في حل هذا السؤال

Write a program to implement an ATM System. The ATM system consists of the following class:

Class Account{

Int AccNo;//account number which is a unique number

Int pinCode;//authentication code

Double balance;//available fund

double interest; // the interest percentage on the debit or credit balance

};

Your program consists of a menu that has the following items:

1. Add an account.

2. Delete last account.

3. Delete an account.

4. Modify an account.

5. Print account information.

6. Charge an account.

7. Withdraw from an account.

8. Exchange money from one account to another.

9. Find the stead.

10. Exit.

Note that you can’t add any account if your system is full, also you can’t delete an account if there is no accounts. Note that AccNo works as primary key. You can use it to do any operation on the account such as delete, modify, search …etc.

Recall from the previous assignment that any operation needs an authentication before its completed.

To calculate the stead, use the given equation in the previous assignment.

You can exit from the system by choosing choice 10 only.

Your system should appear the menu after every choice.

#2

يجب ان تعرض محاولتك قبل طلب اي مساعدة، اسف

ولكن هذه قوانين المنتدى

طلب الحلول بدون مساعدة قد يعرض مواضعيك للإغلاق او الحذف

بالتوفيق

No intellectual battle was ever won through retreat
You do not watch Gintama? Dude, you are missing a lot!


صورةmsrgb1485.gif ocajavase7programmerclr.gif

#3
#include<conio.h>
const int s=10;

class account
{ int accno;
int pincode;
double balance;
double interest;
public:
void set(int no,int code,double bal,double intr)
{accno=no;
pincode=code;
balance=bal;
interest=intr;

}
int get_no()
{
return accno;
}
int get_code()
{
return pincode;
}
double get_balance()
{
return balance;
}
double get_interest()
{return interest;}

void print_Account()
{
cout<<"accno is"<<accno<<"\n";
cout<<"pincode is"<<pincode<<"\n";
cout<<"balance is"<<balance<<"\n";
cout<<"interest is"<<interest<<"\n";}


};
class stack
{
private:

account list;
int top,accno,dp;
double balance,interest;
account box_delet;
account b;
public:

stack(){top=-1;
dp=-1;}
void add_delte(account b)
{if(dp==s-1)
cout<<"account delet is full";
else
{ dp++;
account_delet[dp]=b;

}
}
void print_d()
{if(dp==-1)
cout << "the delet account is empty ";

else
for(int i=0;i<=dp;i++)
{ cout<<"the accno is " ;
cout<< account_delete.get_accno()<<"\n";

cout<<" pincod is " ;
cout<< account_delete.get_pincode()<<"\n";
}}

void delet( )
{ int y=0,s=0; account b;
if (top==-1)
cout <<"the stack is empty you can't delete\n ";
else
{ int accno;
cout<<"enter the accno that you want to delete\n";
cin>>accno;
for(int i=0;i<=top;i++)

if(accno==list.get_accno())
{y++;
s=i;
}

if(y==0)
cout<<"accno is not found\n";
else

{ if(accno==list[top].get_accno())
{
add_delte(list[top]);
cout<<"inf of deleted account is";list[top].print_b();
top--;
cout<<"\n";
}

else
{
account t=list[top];
list[top]=list;
list=t;
b=list[top];
add_delte(b);
cout<<"inf of deleted account is";list[top].print_b();
top--;

}

}
}
}



void add(account n)
{

if (top==s-1){cout << "the stack is full "; }
else
{

top++;list[top]=n ;
}
}
void print()
{if(top==-1)
cout << "the stack is empty\n ";

else
for(int i=0;i<=top;i++)
{ cout<<"the accno is " ;
cout<<list.get_carno()<<"\n";

cout<<" pincod is " ;
cout<<list.get_pincod()<<"\n";
cout<<" balance is " ;
cout<<list.get_balance();
cout<<"\n";





}}




void search()
{ if(top==-1)
cout<<"account is empty\n";
else
{ int accno;
cout<<"enter the accno\n";
cin>>accno;
int y=0;
for(int i=0;i<=top;i++)
if(accno==list.get_accno())
{ y=i;
cout<<"account is found in shife# "<<y+1<<"and it inf is\n";
list[y].print_b();}

else

cout<<"not found\n";

}
}
void modify()
{ int accno;
int pincode;
double balance;
double interest;

if(top==-1)
cout<<" the account is empty you can't modify\n";
else
{
cout<<"enter 1.to modify accno\n2.to modify pincod\n 3.to modify palance \n";
cin>>x;
if(x==1)
{ cout<<"enter privious accno \n";
cin>>accno;
int p=0,y=0;account b;
for(int i=0;i<=top;i++)


if(accno==list.get_accno())
{

y++;
p=i;}
if(y==0)
cout<<"account not found you can't modify\n";
else
{ cout<<"account is found enter new accno\n";
cin>>accno1;
listبسم الله الرحمن الرحيم.set_accno(accno1);
cout<<"the account after modify";listبسم الله الرحمن الرحيم.print_b(); }
cout<<"\n";
}
if(x==2)
{ cout<<"enter privious pincod \n";
cin>>pn;
int p=0,y=0;
for(int i=0;i<=top;i++)


if(pincod==list.get_pincod())
{

y++;
p=i;}
if(y==0)
cout<<"account not found you can't modify\n";
else
{ cout<<"account is found enter new pincod\n";
cin>>nn;
listبسم الله الرحمن الرحيم.set_pincod(nn);
cout<<"the account after modify";listبسم الله الرحمن الرحيم.print_b(); }
cout<<"\n";
}
if(x==3)
{cout<<"enter privious balance \n";
cin>>balance;
int p=0,y=0;
for(int i=0;i<=top;i++)


if(pa==list.get_balance())
{

y++;
p=i;}
if(y==0)
cout<<"account is not found in account you can't modify\n";
else
{ cout<<"account is found enter new pin code\n";
cin>>na;
listبسم الله الرحمن الرحيم.set_au(na);
cout<<"the balance after modify";listبسم الله الرحمن الرحيم.print_b(); }
cout<<"\n";
}}}

};








main()
{
stack account;

int c=0;

while(c!=10)
{

cout<<"\t\t::hello enter any thing of the following::\n";
cout<<"1.add an account \n";
cout<<"2.Search for a account by accno\n";
cout<<"3. Delete book by accno\n4.Modify account .\n";
cout<<"5.Print all account in the strak\n.";
cout<<"6.print deleted account \n 7.exit\n";



cin>>c;
if(c==1)
{

account b;
int accno;
double pincod,
cout<<"enter the accno\n";
cin>>accno;
cout<<"enter the pincod\n";
cin>>pincod;
\n";
b.set(accno,pincod);
account.add(b);
}
else
if(c==2)
{


account.search();



}
else
if(c==3)
{
account.delet();

}
else
if(c==4)
{

account.modify();

}
if(c==5)
{


account.print();
}
if(c==6)
{account.print_d();}


}}

هده محاولتي لكن في الكثير من الاخطاء ارجو المساعده

تم تعديل هذه المشاركة بواسطة Xacker في 17 يونيو 2011 في 23:54

#4

انا رفعتو من خلال ملف

noname01.cpp

#5

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

#include<iostream.h>

#include<conio.h>
const int s=10;

class account
{ int accno;
int pincode;
double balance;
double interest;
public:
void set(int no,int code,double bal,double intr)
{accno=no;
pincode=code;
balance=bal;
interest=intr;

}
int get_no()
{
return accno;
}
int get_code()
{
return pincode;
}
double get_balance()
{
return balance;
}
double get_interest()
{return interest;}

void print_Account()
{
cout<<"accno is"<<accno<<"\n";
cout<<"pincode is"<<pincode<<"\n";
cout<<"balance is"<<balance<<"\n";
cout<<"interest is"<<interest<<"\n";}


};
class stack
{
private:

account list;
int top,accno,dp;
double balance,interest;
account box_delet;
account b;
public:

stack(){top=-1;
dp=-1;}
void add_delte(account b)
{if(dp==s-1)
cout<<"account delet is full";
else
{ dp++;
account_delet[dp]=b;

}
}
void print_d()
{if(dp==-1)
cout << "the delet account is empty ";

else
for(int i=0;i<=dp;i++)
{ cout<<"the accno is " ;
cout<< account_delete.get_accno()<<"\n";

cout<<" pincod is " ;
cout<< account_delete.get_pincode()<<"\n";
}}

void delet( )
{ int y=0,s=0; account b;
if (top==-1)
cout <<"the stack is empty you can't delete\n ";
else
{ int accno;
cout<<"enter the accno that you want to delete\n";
cin>>accno;
for(int i=0;i<=top;i++)

if(accno==list.get_accno())
{y++;
s=i;
}

if(y==0)
cout<<"accno is not found\n";
else

{ if(accno==list[top].get_accno())
{
add_delte(list[top]);
cout<<"inf of deleted account is";list[top].print_b();
top--;
cout<<"\n";
}

else
{
account t=list[top];
list[top]=list;
list=t;
b=list[top];
add_delte(b);
cout<<"inf of deleted account is";list[top].print_b();
top--;

}

}
}
}



void add(account n)
{

if (top==s-1){cout << "the stack is full "; }
else
{

top++;list[top]=n ;
}
}
void print()
{if(top==-1)
cout << "the stack is empty\n ";

else
for(int i=0;i<=top;i++)
{ cout<<"the accno is " ;
cout<<list.get_carno()<<"\n";

cout<<" pincod is " ;
cout<<list.get_pincod()<<"\n";
cout<<" balance is " ;
cout<<list.get_balance();
cout<<"\n";





}}




void search()
{ if(top==-1)
cout<<"account is empty\n";
else
{ int accno;
cout<<"enter the accno\n";
cin>>accno;
int y=0;
for(int i=0;i<=top;i++)
if(accno==list.get_accno())
{ y=i;
cout<<"account is found in shife# "<<y+1<<"and it inf is\n";
list[y].print_b();}

else

cout<<"not found\n";

}
}
void modify()
{ int accno;
int pincode;
double balance;
double interest;

if(top==-1)
cout<<" the account is empty you can't modify\n";
else
{
cout<<"enter 1.to modify accno\n2.to modify pincod\n 3.to modify palance \n";
cin>>x;
if(x==1)
{ cout<<"enter privious accno \n";
cin>>accno;
int p=0,y=0;account b;
for(int i=0;i<=top;i++)


if(accno==list.get_accno())
{

y++;
p=i;}
if(y==0)
cout<<"account not found you can't modify\n";
else
{ cout<<"account is found enter new accno\n";
cin>>accno1;
listبسم الله الرحمن الرحيم.set_accno(accno1);
cout<<"the account after modify";listبسم الله الرحمن الرحيم.print_b(); }
cout<<"\n";
}
if(x==2)
{ cout<<"enter privious pincod \n";
cin>>pn;
int p=0,y=0;
for(int i=0;i<=top;i++)


if(pincod==list.get_pincod())
{

y++;
p=i;}
if(y==0)
cout<<"account not found you can't modify\n";
else
{ cout<<"account is found enter new pincod\n";
cin>>nn;
listبسم الله الرحمن الرحيم.set_pincod(nn);
cout<<"the account after modify";listبسم الله الرحمن الرحيم.print_b(); }
cout<<"\n";
}
if(x==3)
{cout<<"enter privious balance \n";
cin>>balance;
int p=0,y=0;
for(int i=0;i<=top;i++)


if(pa==list.get_balance())
{

y++;
p=i;}
if(y==0)
cout<<"account is not found in account you can't modify\n";
else
{ cout<<"account is found enter new pin code\n";
cin>>na;
listبسم الله الرحمن الرحيم.set_au(na);
cout<<"the balance after modify";listبسم الله الرحمن الرحيم.print_b(); }
cout<<"\n";
}}}

};








main()
{
stack account;

int c=0;

while(c!=10)
{

cout<<"\t\t::hello enter any thing of the following::\n";
cout<<"1.add an account \n";
cout<<"2.Search for a account by accno\n";
cout<<"3. Delete book by accno\n4.Modify account .\n";
cout<<"5.Print all account in the strak\n.";
cout<<"6.print deleted account \n 7.exit\n";



cin>>c;
if(c==1)
{

account b;
int accno;
double pincod,
cout<<"enter the accno\n";
cin>>accno;
cout<<"enter the pincod\n";
cin>>pincod;
\n";
b.set(accno,pincod);
account.add(b);
}
else
if(c==2)
{


account.search();



}
else
if(c==3)
{
account.delet();

}
else
if(c==4)
{

account.modify();

}
if(c==5)
{


account.print();
}
if(c==6)
{account.print_d();}


}}';

وهذا هو السؤال

Write a program to implement an ATM System. The ATM system consists of the following class:

Class Account{

Int AccNo;//account number which is a unique number

Int pinCode;//authentication code

Double balance;//available fund

double interest; // the interest percentage on the debit or credit balance

};

Your program consists of a menu that has the following items:

1. Add an account.

2. Delete last account.

3. Delete an account.

4. Modify an account.

5. Print account information.

6. Charge an account.

7. Withdraw from an account.

8. Exchange money from one account to another.

9. Find the stead.

10. Exit.

Note that you can’t add any account if your system is full, also you can’t delete an account if there is no accounts. Note that AccNo works as primary key. You can use it to do any operation on the account such as delete, modify, search …etc.

Recall from the previous assignment that any operation needs an authentication before its completed.

To calculate the stead, use the given equation in the previous assignment.

You can exit from the system by choosing choice 10 only.

Your system should appear the menu after every choice

#6

ارجوكم ساعدوني

مواضيع مشابهة

عدد الزوار حالياً

المتواجدون خلال آخر دقيقتين · يتحدّث كل ٣٠ ثانية

—الإجمالي—أعضاء مسجّلون—زوار بدون تسجيل

جارٍ التحقق من المتواجدين…