Pages

💡 Now You Can Get your Assignments Sollution here... .💡 100% plagiarism Free Service...💡 Responsibility, punctuality and on-time delivery... 💡 Furnishing you with experts... 💡 experienced in your subject 100% privacy... 💡 helping you with the highest efficiency , professionalism Affordable and budget-friendly costs that do not make a hole in your wallet

C++ program to work as ATM counter

#include<iostream>
using namespace std;
void calculation(int&,int&,int&,int&);
void output(int,int,int,int);
void main()
{
int amount,five=0,thau=0,fthau=0;

do
{
cout<<"Enter Amount in limit of 25000 and *ple of 500:";
cin>>amount;
}while(amount>25000);
int temp=amount;
calculation(amount,five,thau,fthau);
output(temp,five,thau,fthau);
}
void calculation(int &amount,int &five,int &thau,int &fthau)
{
do
{
if(amount>=5000 && amount<=25000)
{
fthau=amount/5000;
amount=amount-(fthau*5000);
}
else
if(amount>=2000 && amount<5000)
{
thau=amount/1000;
amount-=(thau*1000);
}
else
if(amount>=500 && amount<2000)
{
five=amount/500;
amount-=(five*500);
}
}while(amount>=500);
if(amount<500 && amount!=0)
{
cout<<"Less then 500\\ is neglected and not deducted from your account\n";
system("pause");
}
}
void output(int amount,int five,int thau,int fthau)
{
system("cls");
cout<<"\nYour amount:"<<amount;
cout<<"\n=================================================\n";
cout<<"5000\\ Rupees notes:"<<fthau;
cout<<"\n1000\\ Rupees notes:"<<thau;
cout<<"\n500\\ Rupees notes:"<<five;
cout<<"\n=================================================\n";
}

No comments: