0% found this document useful (0 votes)
81 views12 pages

Bjit PDF

The document is a C++ program written by Biswajit for managing a music shop. The program allows the user to input details of music inventory, sales, expenses and provides calculations. It has sections for acknowledging the program, introducing it, and explaining the program code which collects input on shop name, owner, staff salaries, expenses, opening stock of 3 categories of music (movie, non-movie, religious), sales made and calculates totals.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
81 views12 pages

Bjit PDF

The document is a C++ program written by Biswajit for managing a music shop. The program allows the user to input details of music inventory, sales, expenses and provides calculations. It has sections for acknowledging the program, introducing it, and explaining the program code which collects input on shop name, owner, staff salaries, expenses, opening stock of 3 categories of music (movie, non-movie, religious), sales made and calculates totals.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 12

Netaji Subhas DAV Public School

Name: Biswajit Bhowmick


Class: XI
Roll: 03
Subject: Computer Science
Topic: C++ Program for aid to manage a music shop…

C++ Program…
By Biswajit…
INDEX
Sl.no. Topic Page Date Teacher’s Remark
1. Acknowledgement 2
2. Introduction 3
3. The Program 4-10
4
5
6

PAGE 1
ACKNOWLEDGEMENT

PAGE 2
INTRODUCTION
The program that is made by me is based on the idea of simplifying the problems faced for
managing a shop. The program is done in C++.

PAGE 3
THE PROGRAM
#include<iostream.h>
#include<conio.h>
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
struct biswajit
{
char albumm[50],albumn[50],albumr[50];
char cnamem[50],cnamen[50],cnamer[50];
char conamem[50],conamen[50],conamer[50];
char addressm[128],addressn[128],addressr[128];
float qm,qn,qr;
float pricem,pricen,pricer;
};
void main()
{
biswajit b[60];
clrscr();
char user[50],nshop[100],owner[50];
char albumm[50];
int cmd1,cmd2,cmd3;
float sn,salary,tsalary;
float totalcdm=0,totalcdn=0,totalcdr=0;
float stockm,stockn,stockr,bstockm,bstockn,bstockr;
float salem,salen,saler;//sales made in three categories...
float i,j,k,l,m,n;//for array...
float tpricem,tpricen,tpricer;//total sellin price...
float opricem,opricen,opricer;//opening price i.e., buying price...here
float bpricem,bpricen,bpricer;//balance price
float topricem,topricen,topricer;//total opening price...
float tbill,ebill,otherexp,texpences;
float cp,sp;
char ul1[1],ul2[1],ul3[1],ul4[1],ul5[1];//no use of them only to see the
next...
cout<<"\n######################################################################
##########";
cout<<" Hey listen its a Program which will make managing \n
A MUSIC SHOP very easy...LETS START>>>";
cout<<"\n######################################################################
##########";
cout<<"\n**********************************************************************
**********";
cout<<"\nLets introduce ourself...";
cout<<"\n I am Detective... Who are you???";
gets(user);
cout<<"\n Oookk... Your name is "<<user<<"...";
if((strcmp(user,"Asraf")==0) ||(strcmp(user,"Rizvi")==0) ||
(strcmp(user,"Biswajit")==0) || (strcmp(user,"BJIT")==0))
cout<<"\n Its really a AWESOME name sir...";
else
cout<<"\n Its a gooood name...";
cout<<"\n Whats the name of the shop???";
gets(nshop);
cout<<"\n Ok I will remember the shop's name "<<user<<" i.e. "<<nshop;

PAGE 4
cout<<"\nAre you the owner of the shop...";
cout<<"\nIf Yes Press 1";
cout<<"\nIf No then Press 2 And Enter the owner's name...";
cin>>cmd1;
{
if(cmd1==1)
strcpy(owner,user);
else
if(cmd1==2)
gets(owner);
else
cout<<"\n##########Wrong input ENTER properly by RESTARTing
ME>>>##############";
}
if(cmd1==1 || cmd1==2)
{
cout<<"\nHmm... I have memorised the owner's name... i.e. our one and only
"<<owner<<"\n";
cout<<user<<" now lets know few things about "<<nshop<<" which will inculde
expences of the shop and other few things:-";
cout<<"\nSo "<<user<<" now please enter the number of staff working in the
"<<nshop<<"...";
cin>>sn;
cout<<"\nWhats the monthly salary given to them... "<<user<<" please enter>>>";
cin>>salary;
tsalary=salary*sn;
cout<<"Is "<<nshop<<" having any telephone...";
cout<<"\nIf Yes then press 1";
cout<<"\nIf No then press 2";
cin>>cmd2;
if(cmd2==1)
{cout<<"\nEnter the telephone bill...";
cin>>tbill;}
if(cmd2==2)
cout<<"\nHmm Ok I got it but "<<owner<<" should have a telephone for business
convenience...";
cout<<"\nHey,"<<user<<" Whats the electric bill of this month of "<<nshop<<":";
cin>>ebill;
cout<<"\n"<<user<<" also please enter other expences of this month :";
cin>>otherexp;
texpences=otherexp+tbill+tsalary;
cout<<"\nSO "<<user<<" LETS START OUR JOURNEY>>>>\n";
cout<<"I have got the information that "<<owner<<"'s shop "<<nshop<<" sells
three kinds of ";
cout<<"\nCDs and cassttes>>>\n";
cout<<"So Enter the opening stock of the music shop "<<nshop<<" \nin three
differnt categories ";
cout<<"i.e.>>>\n\t\t\tFOR Movie CD and Cassette";
cin>>stockm;
cout<<"\n \t\t\tFOR Non-Movie CD and Cassette";
cin>>stockn;
cout<<"\n \t\t\tFOR Religious CD and Cassette";
cin>>stockr;
cout<<"\nI have got it...\n";
cout<<user<<" please enter the price by which "<<stockm<<" number of Movie
cassettes and CDs each had been bought::Rs";
cin>>opricem;
topricem=opricem*stockm;
cout<<"\nNow please enter the price by which "<<stockn<<" number of Non-Movie
cassettes and CDs each had been bought::Rs";
cin>>opricen;
topricen=opricen*stockn;

PAGE 5
cout<<"\nAt last please enter the price by which "<<stockr<<" number of
Religious cassettes and CDs each had been bought::Rs";
cin>>opricer;
topricer=opricer*stockr;
cout<<"\nNow If "<<owner<<" have sold any cassettes or CDs then please store
the information in me...";
cout<<"\nEnter the number of purchases made today seperately for three
categories...";
cout<<"\nLets start with the first category i.e.";
cout<<"\n======================================================================
==";
cout<<" \nMovie CDs and Cassettes>>>";
cout<<"\n======================================================================
==";
cout<<"\nEnter the number of sales made today in this category:";
cin>>salem;
for(i=1;i<=salem;i++)
{
cout<<"\nEnter the name of the customer number "<<i<<":";
gets(b[i].cnamem);
cout<<"\nWhat is "<<b[i].cnamem<<"'s Address (write it by giving comma): ";
gets(b[i].addressm);
cout<<"\nWrite the quantity of casettes and CDs bought by "<<b[i].cnamem<<": ";
cin>>b[i].qm;
for(j=1;j<=b[i].qm;j++)
{
cout<<"\nWhats the album name of the CD number "<<j<<" bought by
"<<b[i].cnamem<<" :";
gets(b[j].albumm);
cout<<"\nWhat is the name of the company of the CD of album name
"<<b[j].albumm<<" :";
gets(b[j].conamem);
cout<<"\nWhats the price of the CD purchased by "<<b[i].cnamem<<" with album
name "<<b[j].albumm<<" :";
cin>>b[j].pricem;
cout<<"\n* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* * * ";
}
cout<<"\n||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|||||||||";
cout<<"\n||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|||||||||";

cout<<"\nNow for Non-Movie CDs and cassettes...";


cout<<"\n======================================================================
==";
cout<<" \nNon-Movie CDs and Cassettes>>>";
cout<<"\n======================================================================
==";
cout<<"\nEnter the number of sales made today in this category:";
cin>>salen;
for(k=1;k<=salen;k++)
{
cout<<"\nEnter the name of the customer number "<<k<<":";
gets(b[k].cnamen);
cout<<"\nWhat is "<<b[k].cnamen<<"'s Address (write it by giving comma):";
gets(b[k].addressn);
cout<<"\nWrite the quantity of casettes and CDs bought by "<<b[k].cnamen<<" :";
cin>>b[k].qn;
for(l=1;l<=b[k].qn;l++)

PAGE 6
{
cout<<"\nWhats the album name of the CD number "<<l<<" bought by
"<<b[k].cnamen<<" :";
gets(b[l].albumn);
cout<<"\nWhat is the name of the company of the CD of album name
"<<b[l].albumn<<" :";
gets(b[l].conamen);
cout<<"\nWhats the price of the CD purchased by "<<b[k].cnamen<<" with album
name "<<b[l].albumn<<" :";
cin>>b[l].pricen;
cout<<"\n* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* * * ";
}
cout<<"\n######################################################################
#########";
cout<<"\n######################################################################
#########";

cout<<"\nYes! "<<user<<" now its time for Religious CDs and casettes>>>>";
cout<<"\n======================================================================
==";
cout<<" \nReligious CDs and Cassettes>>>";
cout<<"\n======================================================================
==";
cout<<"\nEnter the number of sales made today in this category:";
cin>>saler;
for(m=1;m<=saler;m++)
{
cout<<"\nEnter the name of the customer number "<<m<<":";
gets(b[m].cnamer);
cout<<"\nWhat is "<<b[m].cnamer<<"'s Address (write it by giving comma):";
gets(b[m].addressr);
cout<<"\nWrite the quantity of casettes and CDs bought by "<<b[m].cnamer<<": ";
cin>>b[m].qr;
for(n=1;n<=b[m].qr;n++)
{
cout<<"\nWhats the album name of the CD number "<<n<<" bought by
"<<b[m].cnamer<<" :";
gets(b[n].albumr);
cout<<"\nWhat is the name of the company of the CD of album name
"<<b[n].albumr<<" :";
gets(b[n].conamer);
cout<<"\nWhats the price of the CD purchased by "<<b[m].cnamer<<" with album
name "<<b[n].albumr<<" :";
cin>>b[n].pricer;
cout<<"\n* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* * * ";
}
cout<<"\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
^^^^^^^";
cout<<"\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
^^^^^^^";

for(i=1;i<=salem;i++)
{
totalcdm=totalcdm+b[i].qm;
}
bstockm=stockm-totalcdm;

PAGE 7
for(k=1;k<=salen;k++)
{
totalcdn=totalcdn+b[k].qn;
}
bstockn=stockn-totalcdn;
for(m=1;m<=saler;m++)
{
totalcdr=totalcdr+b[m].qr;
}
bstockr=stockr-totalcdr;

for(j=1;j<=b[i].qm;j++)
{tpricem=tpricem+b[i].pricem;}
for(l=1;l<=b[k].qn;l++)
{tpricen=tpricen+b[l].pricen;}
for(n=1;n<=b[m].qr;n++)
{tpricer=tpricer+b[n].pricer;}

{
if(topricem>tpricem)
cout<<"\n"<<owner<<" had a profit of Rs"<<topricem-tpricem<<" in the first
category Movie CDs and Casettes...";
else
if(topricem<tpricem)
cout<<"\n"<<owner<<" had a loss of Rs"<<tpricem-topricem<<" in the first
category Movie CDs and Casettes...";
else
cout<<"\n"<<owner<<" had no profit and no loss...";
}
cout<<"\nPress any key to continue...";
gets(ul1);
{
if(topricen>tpricen)
cout<<"\n"<<owner<<" had a profit of Rs"<<topricen-tpricen<<" in the Second
category Non-Movie CDs and Casettes...";
else
if(topricen<tpricen)
cout<<"\n"<<owner<<" had a loss of Rs"<<tpricen-topricen<<" in the second
category Non-Movie CDs and Casettes...";
else
cout<<"\n"<<owner<<" had no profit and no loss...";
}
cout<<"\nPlease press any key to cont...";
gets(ul2);
{
if(topricer>tpricer)
cout<<"\n"<<owner<<" had a profit of Rs"<<topricer-tpricer<<" in the third
category i.e. of Religious CDs and Casettes...";
else
if(topricer<tpricer)
cout<<"\n"<<owner<<" had a loss of Rs"<<tpricer-topricer<<" in the third
category i.e. of Religious CDs and Casettes...";
else
cout<<"\n"<<owner<<" had no profit and no loss...";
}
cout<<"\nPlease press any key to cont...";
gets(ul3);

cp=texpences+tpricer+tpricen+tpricem;
sp=topricer+topricen+topricem;

PAGE 8
cout<<"\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~";
cout<<"Its the purchase wise bill of the customers \nwho have bought Movie CDs
and Casettes";
cout<<"\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~";

for(i=1;i<=salem;i++)
{
cout<<"\nFor "<<b[i].cnamem<<":-";
cout<<"\nNumber of CDs and Casettes bought "<<b[i].cnamem<<" is:"<<b[i].qm;
cout<<"\nAdresses is:"<<b[i].addressm;
for(j=1;j<=b[i].qm;j++)
{
cout<<"\nName of album of CD number "<<j<<" is:"<<b[j].albumm;
cout<<"\nCompany of that CD with album name "<<b[j].albumm<<" is
:"<<b[j].conamem;
cout<<"\nPrice of this CD is:"<<b[j].pricem;
cout<<"\n* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* * * ";

}
cout<<"\nPlease press any key to see the next...";
gets(ul3);

cout<<"\n@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@";
cout<<"Its the purchase wise bill of the customers \nwho have bought Non-Movie
CDs and Casettes";
cout<<"\n@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@";

for(k=1;k<=salen;k++)
{
cout<<"\nFor "<<b[k].cnamen<<":-";
cout<<"\nNumber of CDs and Casettes bought "<<b[k].cnamen<<" is:"<<b[k].qn;
cout<<"\nAdresses is:"<<b[k].addressn;
for(l=1;l<=b[k].qn;l++)
{
cout<<"\nName of album of CD number "<<l<<" is:"<<b[l].albumn;
cout<<"\nCompany of that CD with album name "<<b[l].albumn<<" is
:"<<b[l].conamen;
cout<<"\nPrice of this CD is:"<<b[l].pricen;
cout<<"\n* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* * * ";

}
cout<<"\nPlease press any key to see the next...";
gets(ul4);

cout<<"\n$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
$$$$$$$$$$";
cout<<"Its the purchase wise bill of the customers \nwho have bought Movie CDs
and Casettes";
cout<<"\n$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
$$$$$$$$$$";

PAGE 9
for(m=1;m<=saler;m++)
{
cout<<"\nFor "<<b[m].cnamer<<":-";
cout<<"\nNumber of CDs and Casettes bought "<<b[m].cnamer<<" is:"<<b[m].qr;
cout<<"\nAdresses is:"<<b[m].addressr;
for(l=1;l<=b[m].qr;l++)
{
cout<<"\nName of album of CD number "<<l<<" is:"<<b[l].albumr;
cout<<"\nCompany of that CD with album name "<<b[l].albumr<<" is
:"<<b[l].conamen;
cout<<"\nPrice of this CD is:"<<b[l].pricen;
cout<<"\n* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* * * ";

}
cout<<"\nPlease press any key to continue...";
gets(ul5);

cout<<"\n----------------------------------------------------------------------
-------";
cout<<"\nMore Details about today's DAY in "<<nshop<<"...";
cout<<"\n----------------------------------------------------------------------
-------";
cout<<"\nTotal movie cd sold today: "<<totalcdm<<"\nTotal Non-Movie CD sold
today: "<<totalcdn<<"\nTotal religious CD sold today: "<<totalcdr;
cout<<"\nBalance stock of Movie CD: "<<bstockm<<"\nBalance stock of Non-Movie
CD: "<<bstockn<<"\nBalance stock of Religious CD: "<<bstockr;
cout<<"\nTotal Selling price of CDs and casettes of three categories together
:"<<cp;
cout<<"\nTotal Expences of "<<nshop<<" :"<<texpences;
cout<<"\nTotal expences including cost prices of the CDs and Casettes of three
differnt categories together :"<<cp;
if(sp>cp)
cout<<"\nAs a whole i.e. including all the three category of sells "<<owner<<"
had a profit of Rs"<<sp-cp;
else
if(cp>sp)
cout<<"\nAs a whole i.e. including all the three category of sells "<<owner<<"
had a loss of Rs"<<cp-sp;
else
cout<<"\nAs a whole i.e. includeing all the three categiries of sells
"<<owner<<" had no profit nor any loss...";

}
getch();
}
//A program by Biswajit...

PAGE 10
PAGE 11

You might also like