OOP345 Object Oriented Software Development Using C- Parsing string Data

$20 Bonus + 25% OFF

Securing Higher Grades Costing Your Pocket?
Book Your Assignment at The Lowest Price
Now!

Students Who Viewed This Also Studied

OOP345 Object Oriented Software Development Using C++

Task

Milestone 1

Utilities and Station classes

Milestone 1 implements and tests the Utilities and Station modules.

  • The Utilities module supports the parsing of input files, which contain information used to setup and configure the assembly line.
  • The Station module manages information about a station on the assembly line, which holds a specific item and fills customer orders.

The specifications of these two modules are defined below.

Utilities Module

Parsing string data from input files into tokens is performed uniformly for all objects within the simulation system. The Utilities type provides the basic functionality required for all objects in the system.

The Utilities class has the following structure:

Instance Variable

  • m_widthField — specifies the length of the token extracted; used for display purposes; default value is 1.

Class Variable

  • m_delimiter — separates the tokens in any given std::string object. All Utilities objects in the system share the same delimiter.

Member Functions

  • void setFieldWidth(size_t newWidth) — sets the field width of the current object to the value of parameter newWidth
  • size_t getFieldWidth() const — returns the field width of the current object
  • std::string extractToken(const std::string& str, size_t& next_pos, bool& more) — extracts a token from string str referred to by the first parameter
    • This function uses the delimiter to extract the next token from str starting at position next_pos.
    • If successful, this function returns a copy of the extracted token found, updates next_pos with the position of the next token, and sets more to true (false otherwise0.
    • This function reports an exception if a delimiter is found at next_pos.
    • This function updates the current object’s m_widthField data member if its current value is less than the size of the token extracted.
    • Note: in this application, str represents a single line that has been read from an input file

Class Functions

  • static void setDelimiter(char newDelimiter) — sets the delimiter for this class to the character received
  • static char getDelimiter() — returns the delimiter for this class.

Station Module

A Station object manages a single station on the assembly line. Each station handles a specific item for filling customer orders.The Station class has the following structure:

Instance Variables

  • the id of the station (integer)
  • the name of the item handled by the station (string of characters)
  • the description of the station (string of characters)
  • the next serial number to be assigned to an item at this station (non-negative integer)
  • the number of items currently in stock (non-negative integer)

Class Variables

  • m_widthField — the maximum number of characters required to print to the screen the item nameserial number and quantity for any object of type Station. Initial value is 0.
  • id_generator — a variable used to generate IDs for new instances of type Station. Every time a new instance is created, the current value of the id_generator is stored in that instance, and id_generator is incremented. Initial value is 0.

Public Functions

  • custom 1 argument constructor
    • upon instantiation, an Station object receives a reference to an unmodifiable std::string. This string contains a single record (one line) that has been retrieved from the input file specified by the user.
    • this constructor uses a Utilities object (defined locally) to extract each token from the record and populates the Station object accordingly.
    • this constructor assumes that the string contains 4 fields separated by the delimiter, in the following order:
      • name of the item
      • starting serial number
      • quantity in stock
      • description
    • the token delimiter is a single character, specified by the client and previously stored into the Utilitiesclass of objects.
    • this constructor extracts namestarting serial number, and quantity from the string first
    • before extracting description, it updates Station::m_widthField to the maximum value of Station::m_widthField and Utilities::m_widthField.
      • Note: the display(…) member function uses this field width to align the output across all the records retrieved from the file.
  • const std::string& getItemName() const – returns the name of the current Station object
  • size_t getNextSerialNumber() – returns the next serial number to be used on the assembly line and increments m_serialNumber
  • size_t getQuantity() const – returns the remaining quantity of items in the Station object
  • void updateQuantity() – subtracts 1 from the available quantity; should not drop below 0.
  • void display(std::ostream& os, bool full) const — inserts information about the current object into stream os.
    • if the second parameter is false, this function inserts only the ID, name, and serial number in the format: [ID] Item: NAME [SERIAL]
    • if the second parameter if true, this function inserts the information in the following format: [ID] Item NAME [SERIAL] Quantity: QTY Description: DESCRIPTION
    • the ID field uses 3 characters, the NAME and QTY fields use m_widthField characters, the serial number field uses 6 characters; the DESCRIPTION has no formatting options (see the sample output for other formatting options)
    • this function terminates the printed message with an endline

Tester Module

The tester module and the input files are included in the repository. Do not modify any of them.

Sample Output

Look in the file ms1_output.txt for the command line necessary to start the application and the expected output.

OOP345 Object Oriented Software Development Using C++

Answer in Detail


Solved by qualified expert

Get Access to This Answer

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Hac habitasse platea dictumst vestibulum rhoncus est pellentesque. Amet dictum sit amet justo donec enim diam vulputate ut. Neque convallis a cras semper auctor neque vitae. Elit at imperdiet dui accumsan. Nisl condimentum id venenatis a condimentum vitae sapien pellentesque. Imperdiet massa tincidunt nunc pulvinar sapien et ligula. Malesuada fames ac turpis egestas maecenas pharetra convallis posuere. Et ultrices neque ornare aenean euismod. Suscipit tellus mauris a diam maecenas sed enim. Potenti nullam ac tortor vitae purus faucibus ornare. Morbi tristique senectus et netus et malesuada. Morbi tristique senectus et netus et malesuada. Tellus pellentesque eu tincidunt tortor aliquam. Sit amet purus gravida quis blandit. Nec feugiat in fermentum posuere urna. Vel orci porta non pulvinar neque laoreet suspendisse interdum. Ultricies tristique nulla aliquet enim tortor at auctor urna. Orci sagittis eu volutpat odio facilisis mauris sit amet.

Tellus molestie nunc non blandit massa enim nec dui. Tellus molestie nunc non blandit massa enim nec dui. Ac tortor vitae purus faucibus ornare suspendisse sed nisi. Pharetra et ultrices neque ornare aenean euismod. Pretium viverra suspendisse potenti nullam ac tortor vitae. Morbi quis commodo odio aenean sed. At consectetur lorem donec massa sapien faucibus et. Nisi quis eleifend quam adipiscing vitae proin sagittis nisl rhoncus. Duis at tellus at urna condimentum mattis pellentesque. Vivamus at augue eget arcu dictum varius duis at. Justo donec enim diam vulputate ut. Blandit libero volutpat sed cras ornare arcu. Ac felis donec et odio pellentesque diam volutpat commodo. Convallis a cras semper auctor neque. Tempus iaculis urna id volutpat lacus. Tortor consequat id porta nibh.

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Hac habitasse platea dictumst vestibulum rhoncus est pellentesque. Amet dictum sit amet justo donec enim diam vulputate ut. Neque convallis a cras semper auctor neque vitae. Elit at imperdiet dui accumsan. Nisl condimentum id venenatis a condimentum vitae sapien pellentesque. Imperdiet massa tincidunt nunc pulvinar sapien et ligula. Malesuada fames ac turpis egestas maecenas pharetra convallis posuere. Et ultrices neque ornare aenean euismod. Suscipit tellus mauris a diam maecenas sed enim. Potenti nullam ac tortor vitae purus faucibus ornare. Morbi tristique senectus et netus et malesuada. Morbi tristique senectus et netus et malesuada. Tellus pellentesque eu tincidunt tortor aliquam. Sit amet purus gravida quis blandit. Nec feugiat in fermentum posuere urna. Vel orci porta non pulvinar neque laoreet suspendisse interdum. Ultricies tristique nulla aliquet enim tortor at auctor urna. Orci sagittis eu volutpat odio facilisis mauris sit amet.

Tellus molestie nunc non blandit massa enim nec dui. Tellus molestie nunc non blandit massa enim nec dui. Ac tortor vitae purus faucibus ornare suspendisse sed nisi. Pharetra et ultrices neque ornare aenean euismod. Pretium viverra suspendisse potenti nullam ac tortor vitae. Morbi quis commodo odio aenean sed. At consectetur lorem donec massa sapien faucibus et. Nisi quis eleifend quam adipiscing vitae proin sagittis nisl rhoncus. Duis at tellus at urna condimentum mattis pellentesque. Vivamus at augue eget arcu dictum varius duis at. Justo donec enim diam vulputate ut. Blandit libero volutpat sed cras ornare arcu. Ac felis donec et odio pellentesque diam volutpat commodo. Convallis a cras semper auctor neque. Tempus iaculis urna id volutpat lacus. Tortor consequat id porta nibh.

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Hac habitasse platea dictumst vestibulum rhoncus est pellentesque. Amet dictum sit amet justo donec enim diam vulputate ut. Neque convallis a cras semper auctor neque vitae. Elit at imperdiet dui accumsan. Nisl condimentum id venenatis a condimentum vitae sapien pellentesque. Imperdiet massa tincidunt nunc pulvinar sapien et ligula. Malesuada fames ac turpis egestas maecenas pharetra convallis posuere. Et ultrices neque ornare aenean euismod. Suscipit tellus mauris a diam maecenas sed enim. Potenti nullam ac tortor vitae purus faucibus ornare. Morbi tristique senectus et netus et malesuada. Morbi tristique senectus et netus et malesuada. Tellus pellentesque eu tincidunt tortor aliquam. Sit amet purus gravida quis blandit. Nec feugiat in fermentum posuere urna. Vel orci porta non pulvinar neque laoreet suspendisse interdum. Ultricies tristique nulla aliquet enim tortor at auctor urna. Orci sagittis eu volutpat odio facilisis mauris sit amet.

Tellus molestie nunc non blandit massa enim nec dui. Tellus molestie nunc non blandit massa enim nec dui. Ac tortor vitae purus faucibus ornare suspendisse sed nisi. Pharetra et ultrices neque ornare aenean euismod. Pretium viverra suspendisse potenti nullam ac tortor vitae. Morbi quis commodo odio aenean sed. At consectetur lorem donec massa sapien faucibus et. Nisi quis eleifend quam adipiscing vitae proin sagittis nisl rhoncus. Duis at tellus at urna condimentum mattis pellentesque. Vivamus at augue eget arcu dictum varius duis at. Justo donec enim diam vulputate ut. Blandit libero volutpat sed cras ornare arcu. Ac felis donec et odio pellentesque diam volutpat commodo. Convallis a cras semper auctor neque. Tempus iaculis urna id volutpat lacus. Tortor consequat id porta nibh.

31 More Pages to Come in This Document. Get access to the complete answer.

We are an assignment help service brand that can provide any kind of academic assignment help. MyAssignmenthelp.com is backed by 3000+ writers who have obtained their degrees from prestigious international universities. Each one of them can provide online assignment help in their field of specialization. We have such a huge team of writers since we provide assignment help services in 100+ academic subjects. Our PhD level expert writers can provide a wide range of services like online assignment help, dissertation writing services, custom essay help and homework help. Our writers serve students from many nations like Australia, UK and US. If you have any assignment related query, then we have a 24×7 live chat support facility for you.

More OOP345 OOP345 Object Oriented Software Development Using C++: Questions & Answers

COSC380 Machine Learning

Question 1:Given the exponential probability density function normalized over the half-interval[0,∞):P(x|λ) =1λe−x/λ,find the value ofλthat maximizes the likelihood function forNi.i.d. data points{x1,…,xN}. Simplify your expression and show all working, givi …

View Answer

Business Management

CQ-Contractors (CQC) has employed three qualified concrete workers (names of the employees are left to your choice) to perform the supplying and laying of concrete floors/blocks/footings in their customers’ plots.  They have plans to perform concrete column foundation works in the future. …

View Answer

XML Technologies

Requirements1. Currently the online Flowerstore template provides “home”, “about us”, “flowers”, “special gifts”, “my account”, “register”, “prices”, and “contact” pages, etc. It needs to include AT LEAST the following two web forms.A search form: for customers to look up details of flowers and/or g …

View Answer

Computer Network

The assignment is to program and analyse two different merge-sort algorithms in java (Recursive and Iterative). Then compare the two and write a report with maximum 8 pages. I have a attached the coursework. …

View Answer

Content Removal Request

If you are the original writer of this content and no longer wish to have your work published on Myassignmenthelp.com then please raise the
content removal request.

Choose Our Best Expert to Help You

Jane Mac

I am a professor of social science in the University of Southern California.

450 – Completed Orders

Hire Me

Still in Two Minds? The Proof is in Numbers!

33845 Genuine Reviews With a Rating of 4.9/5.

Accounting

Assignment: 1400 Pages, Deadline:
8 days

It was very accurate. The research was done very well and I got nice marks . They really helped me with my work as I was struggling

User ID: 5***57 Sydney, Australia

Business Law

Assignment: 8 Pages, Deadline:
9 days

it was great assignment according to what was important, without mistakes, great

User ID: 8***11 Lincoln, Great Britain

Business Law

Assignment: 6.4 Pages, Deadline:
10 days

The assignment done by professional way and I got more than 85 marks for this subject. Thanks for the whole Nerddz team.

User ID: 2***65 Deepdene, Australia

Psychology

Assignment: 6.8 Pages, Deadline:
10 days

Great work done by the Team Nerddz. I got marks more than 85 for the subject. Thank you…

User ID: 2***65 Deepdene, Australia

Management

Assignment: 6 Pages, Deadline:
4 days

It was nice work and written in a good way. It helped me to increase my final grades for the same course and instructor praised me. Got good grades ov …

User ID: 5***29 Calgary, Canada

Economics

Assignment: 3.5 Pages, Deadline:
2 days

It was nice work and written in a good way. It helped me to increase my final grades for the same course and instructor praised me. 1 star less for im …

User ID: 5***29 Calgary, Canada

Management

Home Work: 3 Pages, Deadline:
1 day

This instructor was really very strict but still gave good marks. Abcdefghijklmno

User ID: 5***29 Calgary, Canada

Management

Thesis: 3 Pages, Deadline:
1 day

Amazing work on this! Got good marks excellent work by the writer. I did not expect so much marks

User ID: 5***29 Calgary, Canada

English

Essay: 1.6 Pages, Deadline:
10 hours

Awesome service. I live it and I will continue to work with them I recommend it. Please do consider

User ID: 8***35 United States

Psychology

Assignment: 6.8 Pages, Deadline:
7 hours

i really appriciate your work. thank you so much. you do your best. and you are very hard worker. thank you so much again again.

User ID: 8***33 Australia

Accounting

Assignment: 1400 Pages, Deadline:
8 days

It was very accurate. The research was done very well and I got nice marks . They really helped me with my work as I was struggling

User ID: 5***57 Sydney, Australia

Business Law

Assignment: 8 Pages, Deadline:
9 days

it was great assignment according to what was important, without mistakes, great

User ID: 8***11 Lincoln, Great Britain

Business Law

Assignment: 6.4 Pages, Deadline:
10 days

The assignment done by professional way and I got more than 85 marks for this subject. Thanks for the whole Nerddz team.

User ID: 2***65 Deepdene, Australia

Psychology

Assignment: 6.8 Pages, Deadline:
10 days

Great work done by the Team Nerddz. I got marks more than 85 for the subject. Thank you…

User ID: 2***65 Deepdene, Australia

Management

Assignment: 6 Pages, Deadline:
4 days

It was nice work and written in a good way. It helped me to increase my final grades for the same course and instructor praised me. Got good grades ov …

User ID: 5***29 Calgary, Canada

Economics

Assignment: 3.5 Pages, Deadline:
2 days

It was nice work and written in a good way. It helped me to increase my final grades for the same course and instructor praised me. 1 star less for im …

User ID: 5***29 Calgary, Canada

Management

Home Work: 3 Pages, Deadline:
1 day

This instructor was really very strict but still gave good marks. Abcdefghijklmno

User ID: 5***29 Calgary, Canada

Management

Thesis: 3 Pages, Deadline:
1 day

Amazing work on this! Got good marks excellent work by the writer. I did not expect so much marks

User ID: 5***29 Calgary, Canada

English

Essay: 1.6 Pages, Deadline:
10 hours

Awesome service. I live it and I will continue to work with them I recommend it. Please do consider

User ID: 8***35 United States

Psychology

Assignment: 6.8 Pages, Deadline:
7 hours

i really appriciate your work. thank you so much. you do your best. and you are very hard worker. thank you so much again again.

User ID: 8***33 Australia

Have any Query?

GET HELP WITH YOUR HOMEWORK PAPERS @ 25% OFF

For faster services, inquiry about  new assignments submission or  follow ups on your assignments please text us/call us on +1 (251) 265-5102

Write My Paper Button

WeCreativez WhatsApp Support
We are here to answer your questions. Ask us anything!
👋 Hi, how can I help?
Scroll to Top