In the space below write a C++ program that computes the total amount of money you are depositing in your bank account. Your program does this by asking you to first enter the type of cash bills being deposited and how many of each type, also the types of coins being deposited and the number of each coin type
#include<iostream>
using namespace std;
int main(){
int amount,a,b,c,d,e,f,g,h,i,j,total_sum;
cout<<"\nEnter the amount of cash= ";
cin>>amount;
cout<<"\nEnter the no. of 2000Rs notes= ";
cin>>a;
cout<<"\nEnter the no. of 500Rs notes= ";
cin>>b;
cout<<"\nEnter the no. of 200Rs notes=";
cin>>c;
cout<<"\nEnter the no. of 100Rs notes=";
cin>>d;
cout<<"\nEnter the no. of 50Rs notes=";
cin>>e;
cout<<"\nEnter the no. of 20Rs notes=";
cin>>f;
cout<<"\nEnter the no. of 20Rs notes=";
cin>>g;
cout<<"\nEnter the no. of 5Rs notes=";
cin>>h;
cout<<"\nEnter the no. of 2Rs notes=";
cin>>i;
cout<<"\nEnter the no. of 1Rs notes=";
cin>>j;
total_sum=a*2000+b*500+c*200+d*100+e*50+f*20+g*10+h*5+i*2,j*1;
cout<<"Total sum = "<<total_sum;
return 0;
}
Comments
Leave a comment