You are on page 1of 4

#include <iostream.

h>
#include <conio.h>
#include <string.h>

int dis_type_value;

class ITEM
{
int i_code [100];
float i_price [100];
float i_dis [100];
float cgst [100];
float sgst [100];
char i_name [100][20];
float total;
int quantity[100];
float t_dis;

public:
void add_item (int i);
void remove_item (int i);
void modify_item (int i);
void discount ();
void bill ();
void display ();
void GST ();
};

void ITEM :: add_item (int i)


{
cout << "Item " << i+1 << " :\n";
cout << "Enter the code of the item: ";
cin >> i_code[i];
cout << "\nEnter the name of the item: ";
cin.getline (i_name[i], 20);
cout << "Enter the price of the item: ";
cin >> i_price[i];
cout << "Enter the quantity of the array: ";
cin >> quantity[i];
}

void ITEM :: remove_item (int x)


{
int a, b;
cout << "Enter the code of the item to be deleted: ";
cin >> a;
for (int i=0; i<x; i++)
{
if(i_code[i] == a)
b = i;
else
cout << "Item code not found\n";
}
for (i=b; i<x; i++)
{
i_code [i] = i_code [i+1];
i_price [i] = i_price [i+1];
i_name [i] = i_name [i+1];
quantity[i] = quantity [i+1];
}
}

void ITEM :: modify_item (int x)


{
int a, b;
cout << "Enter the code of the element: ";
cin >> a;
for (int i=0; i<x; i++)
{
if(i_code[i] == a)
b = i;
else
cout << "Item code not found\n";
}
cout << "What you want to modify\n";
cout << "1. Price\n";
cout << "2. Name\n";
cout << "3. Quantity\n";
int ch;
cin >> ch;
switch (ch)
{
case 1 : cout << "Enter the new price of the item: ";
cin >> i_price[b];
break;
case 2 : cout << "Enter the new Name of the item: ";
cin.getline (i_name[b],100);
break;
case 3 : cout << "Enter the quantity of the item: ";
cin >> quantity;
break;
default : cout << "Wrong choice\n";
break;
}
}

void ITEM :: discount (void)


{
cout << "How to enter the discount\n";
cout << " 1. Discount per item\n";
cout << " 2. Total discount \n";
cout << "Enter your choice: ";
int ch1;
cin >> ch1;
dis_type_value = ch1;
cout << "Enter the total number of item entered: ";
int a;
cin >> a;
switch (ch1)
{
case 1 : cout << "DISCOUNT PER ITEM\n";
for(int i=0; i<a; i++)
{
cout << "Item code of item " << i+1<< " is " <<
i_code [i];
cout << "Enter the discount value: ";
cin >> i_dis[i];
}
break;
case 2 : cout << "DISCOUNT ON TOTAL\n";
cout << "The total price of all item is: ";
for (i=0; i<a; i++)
{
total += i_price[i];
}
cout << total;
cout << "Enter the discount value: ";
cin >> t_dis;
break;
default : cout << "Wrong choice\n";
break;
}
}

void ITEM :: GST (void)


{
cout << "Enter CGST: ";
cin << cgst;
cout << "Enter SGST: ";
cin >> sgst;
cout << "Total value of GTS: " << cgst+sgst;
}

void ITEM :: display (int x)


{
cout << "\tBill Prototype\n";
cout <<
"*********************************************************************************"
;
cout << "S.NO ITEM CODE ITEM PRICE ITEM NAME";
for (int i=0; i<x; i++)
{
cout << i << " " << i_code[i] << " " << i_price[i] << "
" << i_name[i] << "\n";
}
}

void

void pade_1 (void)

{
cout << "******************************************************************\n"
cout << "\t C++ Project\n";
cout << "******************************************************************\n"
cout << "\t CBSE class 12\n\n";
cout << "\T SALES MANAGEMENT\n\n";
cout << "Program Creator \ CODERS \n";
cout << "-------------------------\n\n";
cout << "1. RAGHAV AGARWAL \n";
cout << "2. ASHISH JAMUDA \n";
cout << "3. RAHUL BISWAKARMA \n";
cout << "under guidance of Mrs Rosalini Mam \n\n";
cout << "Features of the Program \n";
cout << "------------------------\n\n";
cout << "1. Create item list\n2. Remove"
}

You might also like