Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
C
CSC220_SDGA_Inventory_System
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
COSC220_Software_Development_Group_Assignment
CSC220_SDGA_Inventory_System
Commits
189835ff
Commit
189835ff
authored
1 year ago
by
Neha Bagga
Browse files
Options
Downloads
Patches
Plain Diff
Developed Basic Inventory System
parent
b75125e3
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
inventory_management_system.cpp
+76
-0
76 additions, 0 deletions
inventory_management_system.cpp
with
76 additions
and
0 deletions
inventory_management_system.cpp
0 → 100644
+
76
−
0
View file @
189835ff
#include
<iostream>
#include
<string>
#include
<vector>
using
namespace
std
;
class
Toy
{
private:
string
name
;
string
material
;
string
description
;
double
manufacturingPrice
;
int
quantityInStock
;
public:
Toy
(
string
n
,
string
m
,
string
desc
,
double
price
,
int
quantity
)
:
name
(
n
),
material
(
m
),
description
(
desc
),
manufacturingPrice
(
price
),
quantityInStock
(
quantity
)
{}
// Getter methods
string
getName
()
const
{
return
name
;
}
string
getMaterial
()
const
{
return
material
;
}
string
getDescription
()
const
{
return
description
;
}
double
getManufacturingPrice
()
const
{
return
manufacturingPrice
;
}
int
getQuantityInStock
()
const
{
return
quantityInStock
;
}
// Setter methods
void
setName
(
string
n
)
{
name
=
n
;
}
void
setMaterial
(
string
m
)
{
material
=
m
;
}
void
setDescription
(
string
desc
)
{
description
=
desc
;
}
void
setManufacturingPrice
(
double
price
)
{
manufacturingPrice
=
price
;
}
void
setQuantityInStock
(
int
quantity
)
{
quantityInStock
=
quantity
;
}
// Display toy details
void
display
()
const
{
cout
<<
"Toy Name: "
<<
name
<<
endl
;
cout
<<
"Material: "
<<
material
<<
endl
;
cout
<<
"Description: "
<<
description
<<
endl
;
cout
<<
"Manufacturing Price: $"
<<
manufacturingPrice
<<
endl
;
cout
<<
"Quantity in Stock: "
<<
quantityInStock
<<
endl
;
}
};
class
Inventory
{
private:
vector
<
Toy
>
toys
;
public:
// Add a new toy to the inventory
void
addToy
(
const
Toy
&
toy
)
{
toys
.
push_back
(
toy
);
}
// Display all toys in the inventory
void
displayInventory
()
const
{
cout
<<
"=== Inventory ==="
<<
endl
;
for
(
const
Toy
&
toy
:
toys
)
{
toy
.
display
();
cout
<<
"----------------"
<<
endl
;
}
}
};
int
main
()
{
Inventory
inventory
;
// Adding sample toys to the inventory
Toy
toy1
(
"Toy1"
,
"Plastic"
,
"A fun toy"
,
5.99
,
50
);
Toy
toy2
(
"Toy2"
,
"Wood"
,
"Educational toy"
,
9.99
,
30
);
inventory
.
addToy
(
toy1
);
inventory
.
addToy
(
toy2
);
// Display the inventory
inventory
.
displayInventory
();
return
0
;
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment