#include <iostream> #include<conio.h> #include<windows.h> using namespace std; int main() { char name[10][20]; int list[10][3]; int n,bill=0, payment, balance; system("color 3f"); cout<<"How many Items.? [MAX.10] : "; cin>>n; for(int i=0; i<n; i++) { system("cls"); cout<<"\t Item "<<i+1<<" : "<<endl; cout<<"Enter Item Name : "; cin>>name[i]; cout<<"Enter amount of "<<name[i]<<" : "; cin>>list[i][0]; cout<<"Enter Cost per unit : "; cin>>list[i][1]; list[i][2]=list[i][0]*list[i][1]; } system("cls"); for(int i=0; i<n; i++) bill+=list[i][2]; cout<<"Total Bill = "<<bill<<endl; cout<<"Enter Payment = "; cin>>payment; balance= payment-bill; cout<<"\n\n\n"; cout<<"\t Payment Slip\n"<<endl cout<<" Items = "; for(int i=0; i<n; i++) { cout<<name[i]; if(i<n-2) cout<<" , "; if(i==n-2) cout<<" and "; } cout<<" Bill = "<<bill<<endl; cout<<" Payment = "<<payment<<endl; cout<<" Remaining Balance = "<<balance<<endl; cout<<"\nThank You For Visiting Our Shop."<<endl; cout<<endl<<endl; return 0; }
Billing detail of Shop in C++
Post A Comment:
0 comments: