OOP345 – Project – Milestone 1 Solved

$ 20.99
Category:

Description

Assembly Line – Inventory Items and Project Utilities
In this project, you are to code a simulation of an assembly line in three separate milestones.

LEARNING OUTCOMES
Upon successful completion of this project, you will have demonstrated the abilities to
• design and code a composition
• work with vector and queue containers from the Standard Template Library
• work with class variables and functions
• parse a string into tokens
• report and handle exceptions
• move objects from one container to another

SUBMISSION POLICY
Milestone Submission Dates:
PROJECT OVERVIEW
Figure 1 – Simulator Classes

SPECIFICATIONS
Milestone 1 builds the Inventory and the Utilities for the Assembly Line. This milestone consists of four modules:
• project (supplied)
• AssemblyLine (supplied)
• Utilities
• ItemSet
Enclose all your source code within the sict namespace and include the necessary guards in each header file. The output from your executable running Visual Studio with the following command line argument should look like
Command Line : C:Users…DebugMS1.exe Inventory.txt

Inventory Assembly ================== Items in Stock
————–
CPU [123456] Quantity 5 Description: Central Processing Unit Memory [654321] Quantity 10 Description: Basic Flash Memory
GPU [456789] Quantity 2 Description: General Processing Unit
SSD [987654] Quantity 5 Description: Solid State Drive
Power Supply [147852] Quantity 20 Description: Basic AC Power Supply

For Manual Validation getName(): CPU getSerialNumber(): 123456 getQuantity(): 5 getSerialNumber(): 123457 getQuantity(): 4

Inventory Assembly Complete

The input for testing your solution is stored in a supplied file. The name of the file is specified on the command line as shown in red above. Its records are
CPU|123456|5|Central Processing Unit Memory|654321|10|Basic Flash Memory GPU|456789|2|General Processing Unit SSD|987654|5|Solid State Drive Power Supply|147852|20|Basic AC Power Supply
Each record consists of 4 fields delimited by a prescribed char (‘|’) for the project. The fields are:
• Name of the inventory item in the item set
• Number of items in the item set
• Description of any item in the item set
Utilities Module
The Utilities module is a support module that contains the functionality that is common across the system. All objects in the system parse string data in the same way, use the same delimiter and report data fields in tabular format.
Design and code a class named Utilities for extracting tokens from a string, which consists of a set of fields separated by a specified delimiter and determining a field width that is sufficiently large to accommodate the tokens for a specified field. The field width is to be used to construct the output tables for the project (as shown in the sample output above). Tokens in a string are separated by one delimiter character (see the input file shown in red above).
Your class design includes the following public member functions:
• A default constructor that places the object in a safe empty state and initializes its field width to a size that is less than the possible size of any token.
• const std::string extractToken(const std::string& str, size_t&
next_pos) – a modifier that receives a reference to an unmodifiable string str and a reference to a position next_pos in that string. This function extracts the next token in the string starting at the position next_pos, and ending immediately before the delimiter character. This function compares the size of the extracted token to the field width currently stored in the object and if the size of the token is greater than that width increases that width. This function returns in next_pos the position of the next token in the string if one exists. If not, this function returns the position that is beyond the end of the string. This function reports an exception if one delimiter follows another without any token between them.
• const char getDelimiter() const – a query that returns the delimiter character
• size_t getFieldWidth() const – a query that returns the field width for the current object
• void setDelimiter(const char d) – a modifier that set the
delimiter character for all object of this class
• void setFieldWidth(size_t) – a modifier that set the field width for the current object

ItemSet Module
Design and code a class named ItemSet for managing the stock inventory of a particular item. Your class design includes the following public member functions:
• A constructor that receives a reference to an unmodifiable string, extracts 4 tokens from the string, populates the object with those tokens and determines the field width to be used in displaying data for all objects of the class.
• const std::string& getName() const – a query that returns a reference to the name of the item
• const unsigned int getSerialNumber() const – a query that returns the serial number of the item
• const unsigned int getQuantity() const – a query that returns the remaining number of items in the set
• ItemSet& operator–() – a prefix decrement operator that reduces the number of items in stock by one and increases the serial number by one. This operator returns a reference to the current
object.
Your design disables copy and move assignment operations and copy construction of the list.

Milestone Submission
To test and demonstrate execution of your program use the same data as shown in the output example above.
Upload your source code to your matrix account. Compile and run your code using the latest version of the gcc compiler and make sure that everything works properly.
Then, run the following command from your account: (replace profname.proflastname with your professor’s Seneca userid)
~profname.proflastname/submit 345XXX_ms1<ENTER>

Reviews

There are no reviews yet.

Be the first to review “OOP345 – Project – Milestone 1 Solved”

Your email address will not be published. Required fields are marked *