Download as pdf or txt
Download as pdf or txt
You are on page 1of 19

Roll Number: 2019108017

Name: MOHAMED FASIL

EX. No 12 Marks :10


Solving Inventory Problems using C++
24-11- CO: 3
2021

Objective:
• To collect data and analyse the Inventory problem
• To use C++ language to perform ABC Classification of items
Instructions
Consider a Store/Industry with lot of items. Collect required data to perform the ABC classification.
Write a program to Classify the items into A, B and C class items.
Rubric for Assessment
CO3 (10 marks)

Level\Criteria Study of inventory System (5 marks) Classification of Items and


And Analysis presentation (5 marks)
High Real time data is collected and ABC classification is done
presented C++ outputs is written to Excel file
Flow chart for C++ Program is Provision for adding items to database
presented and generating the new classification
More than 100 items (5 marks)
EOQ is calculated for A class Items
(5 marks)

Low Assumed Data ABC classification is done


No Flow chart is presented (2 marks)
Very few items
(2 marks)

Course Instructor’s Assessment


CO3 ( 10 Marks) Total (10
Marks)
Level\Criteria Study of inventory System (5 Classification of Items and
marks) presentation (5 marks)
And Analysis
Marks

Contents
1. Abstract
2. Introduction
3. Problem Statement
4. Presentation of Data
5. Flow chart for logic
6. C++ output
7. ABC Classification of items
8. EOQ for A class items
9. Conclusion
Roll Number: 2019108017
Name: MOHAMED FASIL
12.SOLVING INVENTORY PROBLEM USING C++

12.1 ABSTRACT:
Collecting 100 household items data from a supermarket and calculating its monthly
demand based on price, quantity, availability and earnings & needs of customers. ABC
classification is done based on the calculated weighted value and cumulative distribution using
C++ programming language.

12.2 INTRODUCTION:
The objective of the inventory model is to get the most benefit from our inventory with
minimal measure of the venture. In ABC classification, we classify items into high valued items,
average valued items and low valued items based on the obtained cumulative contribution.

12.3 PROBLEM STATEMENT:


The observed supermarket has a variety of items with a wide range of prices. Collect the
data of name of the household items, price and the monthly demand for those 100 items. Obtain
the weighted value and cumulative distribution of these items, classify them based on ABC
classification and tabulate the results. Find the EOQ (Economic Order Quantity) of “A” class
items.

12.4 PRESENTATION OF DATA:


Table-12.1 depicts a list of 100 products and their respective quantity, price and annual demand.

Table 12.1 :
S.No Products list Rate (in Rs.) Demand
1 apples(1kg) 110 70
2 pears(1kg) 120 50
3 bananas(1kg) 80 80
4 oranges(1kg) 100 65
5 berries(1kg) 180 50
6 onions(1kg) 70 200
7 broccoli(1kg) 60 75
8 carrots(1kg) 120 100
9 cucumbers(1kg) 80 150
10 tomatoes(1kg) 40 390
Roll Number: 2019108017
Name: MOHAMED FASIL
11 chicken(1kg) 220 700
12 mutton(1kg) 540 400
13 fish(1kg) 250 500
14 bacon(1kg) 200 70
15 pork(1kg) 200 35
16 garlic(1kg) 180 150
17 mushrooms(1kg) 150 100
18 peppers(100gm) 170 30
19 grapes(1kg) 120 25
20 watermelon(1pc) 80 40
21 lemon(1kg) 180 90
22 mango(1pc) 50 90
23 guava(1kg) 90 30
24 jackfruit(1pc) 25 25
25 milk(1lit) 40 1000
26 butter(100gm) 220 200
27 eggs(4ps) 25 20000
28 curd(100ml) 45 300
29 ghee(1kg) 500 150
30 garbage bags(50pcs) 47 500
31 laundry soap(1pc) 10 420
32 dryer sheets(50pcs) 249 230
33 bleach(100mg) 10 500
34 dish soap(1pc) 15 960
35 hand soap(1pc) 10 300
36 soap(1pc) 50 400
37 shampoo(500ml) 76 200
38 conditioner(25ml) 24 150
39 razors(1pc) 30 160
40 shaving cream(50ml) 150 100
41 deoderent(100ml) 750 150
Roll Number: 2019108017
Name: MOHAMED FASIL
42 lotion(250ml) 140 75
43 toothpaste(200gm) 45 450
44 floss(1pc) 22 60
45 pain reliver(1pc) 44 70
46 cleaner(200ml) 68 300
47 glass cleaner(200ml) 99 200
48 sponges(10pc) 20 250
49 batteries(10pc) 150 130
50 light bulbs(1pc) 59 110
51 yumkmies(1pc) 40 200
52 cookies(1pc) 20 210
53 chips(1pc) 20 220
54 dip(1pc) 35 150
55 crackers(1pc) 50 250
56 candy(1pc) 10 500
57 nuts(20gm) 40 400
58 popcorn(1pc) 25 550
59 raisins(1pc) 35 420
60 snack bars(pc) 25 700
61 salt(1kg) 365 1000
62 pepper(200gm) 837 25
63 faco seasoning(200gm) 145 30
64 spaghetti(1pc) 129 100
65 magroni(1pc) 107 100
66 rice(1kg) 53 1700
67 wheat(1kg) 22 250
68 dog foods(1kg) 655 120
69 cat foods(1kg) 690 80
70 cat litter(1pc) 249 70
71 toilet paper(10pc) 81 400
72 towel(1pc) 71 500
Roll Number: 2019108017
Name: MOHAMED FASIL
73 tissues(10pc) 38 700
74 napkins(5pc) 42 1000
75 plastic baggies(10pc) 130 1000
76 sandwitch(1pc) 150 500
77 fresh leaf(1pc) 65 400
78 bazles(1pc) 79 600
79 muffins(1pc) 69 700
80 buns(10pc) 26 1100
81 cooking oil(500ml) 84 200
82 coconut oil(200ml) 180 150
83 ginger oil(500ml) 240 100
84 olive oil(500ml) 854 75
85 deepam oil(500ml) 101 80
86 mustard(1pc) 41 100
87 jeera(20ml) 136 90
88 puppy seeds(10pc) 155 100
89 omam(10pc) 139 60
90 hing(10pc) 520 60
91 cardamon(10pc) 1900 25
92 cashewnut(10pc) 698 30
93 badam(500g) 1148 22
94 peanuts(10pc) 89 40
95 dates(500g) 121 50
96 cloves(10pc) 65 30
97 kalpasi(10pc) 84 60
98 biriyani spices(10pc) 349 30
99 vanilla essence(20ml) 99 22
100 chocolate essence(20ml) 76 100
Roll Number: 2019108017
Name: MOHAMED FASIL
12.5 C++ CODE :

#include <iostream>
#include <bits/stdc++.h>
#define MAX 150
using namespace std;

int top = 100;


int demand[MAX] = {
70,50,80,65,50,200,75,100,150,390,700,400,500,70,35,150,100,30,25,40,90,90,30,
25,1000,200,20000,300,150,500,420,230,500,960,300,400,200,150,160,100,150,75,
450,60,70,300,200,250,130,110,200,210,220,150,250,500,400,550,420,700,1000,25,
30,100,100,1700,250,120,80,70,400,500,700,1000,1000,500,400,600,700,1100,200,
150,100,75,80,100,90,100,60,60,25,30,22,40,50,30,60,30,22,100
};

int price[MAX] = {
110,120,80,100,180,70,60,120,80,40,220,540,250,200,200,180,150,170,120,80,180,
50,90,25,40,220,25,45,500,47,10,249,10,15,10,50,76,24,30,150,750,140,45,22,44,
68,99,20,150,59,40,20,20,35,50,10,40,25,35,25,365,837,145,129,107,53,22,655,690,
249,81,71,38,42,130,150,65,79,69,26,84,180,240,854,101,41,136,155,139,520,1900,
698,1148,89,121,65,84,349,99,76
};

string names[MAX] = {
"apples(1kg)","pears(1kg)","bananas(1kg)","oranges(1kg)","berries(1kg)",
"onions(1kg)","broccoli(1kg)","carrots(1kg)","cucumbers(1kg)","tomatoes(1kg)",
"chicken(1kg)","mutton(1kg)","fish(1kg)","bacon(1kg)","pork(1kg)",
"garlic(1kg)","mushrooms(1kg)","peppers(100gm)","grapes(1kg)",
"watermelon(1pc)","lemon(1kg)","mango(1pc)","guava(1kg)","jackfruit(1pc)",
"milk(1lit)","butter(100gm)","eggs(4ps)","curd(100ml)","ghee(1kg)",
"garbage bags(50pcs)","laundry soap(1pc)","dryer sheets(50pcs)",
"bleach(100mg)","dish soap(1pc)","hand soap(1pc)","soap(1pc)","shampoo(500ml)"
,"conditioner(25ml)","razors(1pc)","shaving cream(50ml)","deoderent(100ml)",
"lotion(250ml)","toothpaste(200gm)","floss(1pc)","pain reliver(1pc)",
"cleaner(200ml)","glass cleaner(200ml)","sponges(10pc)","batteries(10pc)",
"ligt bulbs(1pc)","yumkmies(1pc)","cookies(1pc)","chips(1pc)","dip(1pc)",
"crackers(1pc)","candy(1pc)","nuts(20gm)","popcorn(1pc)","raisins(1pc)",
Roll Number: 2019108017
Name: MOHAMED FASIL
"snack bars(pc)","salt(1kg)","pepper(200gm)","faco seasoning(200gm)",
"spaghetti(1pc)","magroni(1pc)","rice(1kg)","wheat(1kg)","dog foods(1kg)",
"cat foods(1kg)","cat litter(1pc)","toilet paper(10pc)","towel(1pc)",
"tissues(10pc)","napkins(5pc)","plastic baggies(10pc)","sandwitch(1pc)",
"fresh leaf(1pc)","bazles(1pc)","muffins(1pc)","buns(10pc)",
"cooking oil(500ml)","coconut oil(200ml)","ginger oil(500ml)",
"olive oil(500ml)","deepam oil(500ml)","mustard(1pc)","jeera(20ml)",
"puppy seeds(10pc)","omam(10pc)","hing(10pc)","cardamon(10pc)",
"cashewnut(10pc)","badam(500g)","peanuts(10pc)","dates(500g)",
"cloves(10pc)","kalpasi(10pc)","biriyani spices(10pc)",
"vannila essnce(20ml)","chocalate essence(20ml)"
};

float value[MAX];
float cperc;
float cummulative[MAX];
char iclass[MAX];
int sov= 0;
double q[MAX];

void
sorting ()
{
for (int i = 0; i <= top; i++)
{
for (int j = i + 1; j <= top; j++)
{
if (value[i] < value[j])
{
int temp = value[i];
string tempname = names[i];
names[i] = names[j];
value[i] = value[j];
value[j] = temp;
names[j] = tempname;
}
}
}
Roll Number: 2019108017
Name: MOHAMED FASIL
}

void
additem ()
{
top++;
cout << "\nEnter the item name: "<<endl;
cin >> names[top];
cout << "\nEnter the item price: "<<endl;
cin >> price[top];
cout << "\nEnter the item demand: "<<endl;
cin >> demand[top];
cout << "Item Added.Thank you\n"<<endl;

void
display ()
{
for (int i = 0; i <= top; i++)
{
cout << names[i] << " : Class " << iclass[i] << "\tEOQ: " << q[i] <<
"\n";
}
}

void
valuecalc ()
{
for (int i = 0; i <= top; i++)
{
value[i] = price[i] * demand[i];
}
}

void
classassign ()
{
Roll Number: 2019108017
Name: MOHAMED FASIL
sov = 0;
for (int i = 0; i <= top; i++)
{
sov += value[i];
}
for (int i = 0; i <= top; i++)
{
cperc = float (value[i] * 100 / sov);

cummulative[i] = cummulative[i - 1] + cperc;

if (cummulative[i] < 85 && cummulative[i] > 0)


{
iclass[i] = 'A';
}
else if (cummulative[i] > 85 && cummulative[i] < 95)
{
iclass[i] = 'B';
}
else
{
iclass[i] = 'C';
}
}
}

void
eoq ()
{
for (int i = 0; i <= top; i++)
{
q[i] = sqrt (2 * demand[i] * 1000 / 5);
}
}

int
main ()
{
Roll Number: 2019108017
Name: MOHAMED FASIL
string ch = "yes";
int c;
valuecalc ();
sorting();
classassign ();
eoq ();
while (ch == "yes")
{
cout << "1)Add item\n2)Display Items and their class\nEnter 1 or 2"<<endl;
cin >> c;
switch (c)
{
case 1:
additem ();
valuecalc ();
sorting ();
classassign ();
eoq ();
break;
case 2:
display ();
break;
default:
cout << "please choose correct option"<<endl;
}
cout << "Do you want to continue? press yes or no"<<endl;
cin >> ch;
}
if (ch=="no")
{ cout<<"Thank you!!!";}

return 0;
}
Roll Number: 2019108017
Name: MOHAMED FASIL
12.6 FLOW CHART FOR LOGIC:

FIGURE 12.1
Roll Number: 2019108017
Name: MOHAMED FASIL
12.7 C++ OUTPUT :

1)Add item
2)Display Items and their class
Enter 1 or 2
2
eggs(4ps) : Class A EOQ: 167.332
salt(1kg) : Class A EOQ: 141.421
mutton(1kg) : Class A EOQ: 178.885
chicken(1kg) : Class A EOQ: 161.245
plastic baggies(10pc) : Class A EOQ: 141.421
fish(1kg) : Class A EOQ: 282.843
deoderent(100ml) : Class A EOQ: 173.205
rice(1kg) : Class A EOQ: 200
dog foods(1kg) : Class A EOQ: 244.949
ghee(1kg) : Class A EOQ: 394.968
sandwitch(1pc) : Class A EOQ: 529.15
olive oil(500ml) : Class A EOQ: 400
dryer sheets(50pcs) : Class A EOQ: 447.214
cat foods(1kg) : Class A EOQ: 167.332
muffins(1pc) : Class A EOQ: 118.322
cardamon(10pc) : Class A EOQ: 244.949
bazles(1pc) : Class A EOQ: 200
butter(100gm) : Class A EOQ: 109.545
napkins(5pc) : Class A EOQ: 100
milk(1lit) : Class A EOQ: 126.491
towel(1pc) : Class A EOQ: 189.737
toilet paper(10pc) : Class A EOQ: 189.737
hing(10pc) : Class A EOQ: 109.545
buns(10pc) : Class A EOQ: 100
coconut oil(200ml) : Class A EOQ: 632.456
garlic(1kg) : Class A EOQ: 282.843
tissues(10pc) : Class A EOQ: 2828.43
fresh leaf(1pc) : Class A EOQ: 346.41
badam(500g) : Class A EOQ: 244.949
ginger oil(500ml) : Class A EOQ: 447.214
garbage bags(50pcs) : Class A EOQ: 409.878
cashewnut(10pc) : Class A EOQ: 303.315
Roll Number: 2019108017
Name: MOHAMED FASIL
pepper(200gm) : Class A EOQ: 447.214
cleaner(200ml) : Class A EOQ: 619.677
toothpaste(200gm) : Class A EOQ: 346.41
soap(1pc) : Class A EOQ: 400
glass cleaner(200ml) : Class A EOQ: 282.843
batteries(10pc) : Class A EOQ: 244.949
snack bars(pc) : Class A EOQ: 252.982
cat litter(1pc) : Class B EOQ: 200
cooking oil(500ml) : Class B EOQ: 244.949
lemon(1kg) : Class B EOQ: 173.205
nuts(20gm) : Class B EOQ: 424.264
tomatoes(1kg) : Class B EOQ: 154.919
puppy seeds(10pc) : Class B EOQ: 167.332
shampoo(500ml) : Class B EOQ: 346.41
mushrooms(1kg) : Class B EOQ: 282.843
shaving cream(50ml) : Class B EOQ: 316.228
raisins(1pc) : Class B EOQ: 228.035
dish soap(1pc) : Class B EOQ: 209.762
onions(1kg) : Class B EOQ: 282.843
bacon(1kg) : Class B EOQ: 289.828
popcorn(1pc) : Class B EOQ: 296.648
curd(100ml) : Class B EOQ: 244.949
spaghetti(1pc) : Class B EOQ: 316.228
crackers(1pc) : Class B EOQ: 447.214
jeera(20ml) : Class B EOQ: 400
carrots(1kg) : Class B EOQ: 469.042
cucumbers(1kg) : Class B EOQ: 409.878
magroni(1pc) : Class B EOQ: 529.15
lotion(250ml) : Class B EOQ: 632.456
biriyani spices(10pc) : Class B EOQ: 100
berries(1kg) : Class B EOQ: 109.545
omam(10pc) : Class B EOQ: 200
deepam oil(500ml) : Class C EOQ: 200
yumkmies(1pc) : Class C EOQ: 824.621
apples(1kg) : Class C EOQ: 316.228
chocalate essence(20ml) : Class C EOQ: 219.089
pork(1kg) : Class C EOQ: 178.885
oranges(1kg) : Class C EOQ: 167.332
Roll Number: 2019108017
Name: MOHAMED FASIL
ligt bulbs(1pc) : Class C EOQ: 400
bananas(1kg) : Class C EOQ: 447.214
dates(500g) : Class C EOQ: 529.15
pears(1kg) : Class C EOQ: 632.456
wheat(1kg) : Class C EOQ: 632.456
dip(1pc) : Class C EOQ: 447.214
peppers(100gm) : Class C EOQ: 400
kalpasi(10pc) : Class C EOQ: 489.898
sponges(10pc) : Class C EOQ: 529.15
bleach(100mg) : Class C EOQ: 663.325
candy(1pc) : Class C EOQ: 282.843
razors(1pc) : Class C EOQ: 244.949
broccoli(1kg) : Class C EOQ: 200
mango(1pc) : Class C EOQ: 173.205
chips(1pc) : Class C EOQ: 178.885
faco seasoning(200gm) : Class C EOQ: 200
laundry soap(1pc) : Class C EOQ: 189.737
cookies(1pc) : Class C EOQ: 200
mustard(1pc) : Class C EOQ: 154.919
conditioner(25ml) : Class C EOQ: 154.919
peanuts(10pc) : Class C EOQ: 100
watermelon(1pc) : Class C EOQ: 109.545
pain reliver(1pc) : Class C EOQ: 93.8083
grapes(1kg) : Class C EOQ: 126.491
hand soap(1pc) : Class C EOQ: 141.421
guava(1kg) : Class C EOQ: 109.545
vannila essnce(20ml) : Class C EOQ: 154.919
cloves(10pc) : Class C EOQ: 109.545
floss(1pc) : Class C EOQ: 93.8083
jackfruit(1pc) : Class C EOQ: 200
Do you want to continue? press yes or no

12.8 ABC CLASSIFICATION OF ITEMS:


Table-12.2 depicts ABC classification of the 100 products based on cumulative percentage of
weighted values taken in descending order.
Roll Number: 2019108017
Name: MOHAMED FASIL
Table 12.2:
S.No Products Class
1 eggs(4ps) A
2 salt(1kg) A
3 mutton(1kg) A
4 chicken(1kg) A
5 plasticbaggies(10pc) A
6 fish(1kg) A
7 deoderent(100ml) A
8 rice(1kg) A
9 dogfoods(1kg) A
10 ghee(1kg) A
11 sandwitch(1pc) A
12 oliveoil(500ml) A
13 dryersheets(50pcs) A
14 catfoods(1kg) A
15 muffins(1pc) A
16 cardamon(10pc) A
17 bazles(1pc) A
18 butter(100gm) A
19 napkins(5pc) A
20 milk(1lit) A
21 towel(1pc) A
22 toiletpaper(10pc) A
23 hing(10pc) A
24 buns(10pc) A
25 coconutoil(200ml) A
26 garlic(1kg) A
27 tissues(10pc) A
28 freshleaf(1pc) A
29 badam(500g) A
30 gingeroil(500ml) A
Roll Number: 2019108017
Name: MOHAMED FASIL
31 garbagebags(50pcs) A
32 cashewnut(10pc) A
33 pepper(200gm) A
34 cleaner(200ml) A
35 toothpaste(200gm) A
36 soap(1pc) A
37 glasscleaner(200ml) A
38 batteries(10pc) A
39 snackbars(pc) A
40 catlitter(1pc) B
41 cookingoil(500ml) B
42 lemon(1kg) B
43 nuts(20gm) B
44 tomatoes(1kg) B
45 puppyseeds(10pc) B
46 shampoo(500ml) B
47 mushrooms(1kg) B
48 shavingcream(50ml) B
49 raisins(1pc) B
50 dishsoap(1pc) B
51 onions(1kg) B
52 bacon(1kg) B
53 popcorn(1pc) B
54 curd(100ml) B
55 spaghetti(1pc) B
56 crackers(1pc) B
57 jeera(20ml) B
58 carrots(1kg) B
59 cucumbers(1kg) B
60 magroni(1pc) B
61 lotion(250ml) B
Roll Number: 2019108017
Name: MOHAMED FASIL
62 biriyanispices(10pc) B
63 berries(1kg) B
64 omam(10pc) B
65 deepamoil(500ml) C
66 yumkmies(1pc) C
67 apples(1kg) C
68 chocalateessence(20ml) C
69 pork(1kg) C
70 oranges(1kg) C
71 ligtbulbs(1pc) C
72 bananas(1kg) C
73 dates(500g) C
74 pears(1kg) C
75 wheat(1kg) C
76 dip(1pc) C
77 peppers(100gm) C
78 kalpasi(10pc) C
79 sponges(10pc) C
80 bleach(100mg) C
81 candy(1pc) C
82 razors(1pc) C
83 broccoli(1kg) C
84 mango(1pc) C
85 chips(1pc) C
86 facoseasoning(200gm) C
87 laundrysoap(1pc) C
88 cookies(1pc) C
89 mustard(1pc) C
90 conditioner(25ml) C
91 peanuts(10pc) C
92 watermelon(1pc) C
Roll Number: 2019108017
Name: MOHAMED FASIL
93 painreliver(1pc) C
94 grapes(1kg) C
95 handsoap(1pc) C
96 guava(1kg) C
97 vannilaessnce(20ml) C
98 cloves(10pc) C
99 floss(1pc) C
100 jackfruit(1pc) C

12.9 EOQ FOR A CLASS ITEMS:


Table-12.3 depicts the Economic Order Quantity (EOQ) of A-class items.

Table 12.3:
S.No Products Class EOQ
1 eggs(4ps) A 167.332
2 salt(1kg) A 141.421
3 mutton(1kg) A 178.885
4 chicken(1kg) A 161.245
5 plasticbaggies(10pc) A 141.421
6 fish(1kg) A 282.843
7 deoderent(100ml) A 173.205
8 rice(1kg) A 200
9 dogfoods(1kg) A 244.949
10 ghee(1kg) A 394.968
11 sandwitch(1pc) A 529.15
12 oliveoil(500ml) A 400
13 dryersheets(50pcs) A 447.214
14 catfoods(1kg) A 167.332
15 muffins(1pc) A 118.322
16 cardamon(10pc) A 244.949
17 bazles(1pc) A 200
Roll Number: 2019108017
Name: MOHAMED FASIL
18 butter(100gm) A 109.545
19 napkins(5pc) A 100
20 milk(1lit) A 126.491
21 towel(1pc) A 189.737
22 toiletpaper(10pc) A 189.737
23 hing(10pc) A 109.545
24 buns(10pc) A 100
25 coconutoil(200ml) A 632.456
26 garlic(1kg) A 282.843
27 tissues(10pc) A 2828.43
28 freshleaf(1pc) A 346.41
29 badam(500g) A 244.949
30 gingeroil(500ml) A 447.214
31 garbagebags(50pcs) A 409.878
32 cashewnut(10pc) A 303.315
33 pepper(200gm) A 447.214
34 cleaner(200ml) A 619.677
35 toothpaste(200gm) A 346.41
36 soap(1pc) A 400
37 glasscleaner(200ml) A 282.843
38 batteries(10pc) A 244.949
39 snackbars(pc) A 252.982

12.10 CONCLUSION :
We have collected data for 100 items from around 1000 families and sorted them
according to the ABC classification methodology. They have been categorized into high value,
average value and low value items. Economic Order Quantity (EOQ) for the class A items are
found out using the formula. To improve our business performance, we should focus on class A
items more as their cumulative contribution to total value is very high.

You might also like