A command-line tool to process customer orders of COVID-19 vaccines for a shipping company, developed with C++11.
For more information about the design and implementation of the program, see the design document at: /docs/Design Document - Vaccine Order Processing.pdf
To build the program using CMake, run the following commands in the root directory:
- Configure the build:
cmake -B build
- Run the build:
cmake --build build
Once you have compiled the program, you can run it on an input file with the following command in the root directory:
./build/vaccine_order_processing <input_file>
, where <input_file>
is the
path to the input file.
We have included an example input file in: /resources/order_file.txt
To run the program on the example file, run the following command in the root directory:
./build/vaccine_order_processing resources/order_file.txt
You can also create your own input file. The program accepts input files with the following format:
Column Number | Description |
---|---|
1 | Always 'C' |
2-5 | The customer number - a four-digit, zero-padded integer |
6-45 | The customer's name |
Column Number | Description |
---|---|
1 | Always 'S' |
2-9 | The order date, in the format 'YYYYMMDD' |
10 | The order type - 'N' for a normal order, or 'X' for an express order |
11-14 | The customer number of the customer creating the order |
15-17 | The order quantity - a three-digit, zero-padded integer |
Column Number | Description |
---|---|
1 | Always 'E' |
2-9 | The date for the end of the day, in the format 'YYYYMMDD' |