OUTPUT
The code is ready for submission. Just copy and paste the code into
your IDE and submit it. Remember, you are not supposed to upload
it as a PDF.
Question for Cos2611 Assignment1 for 2026 Warehouse Order Dispatch System Scenario As a second-year IT student, you have been requested by a warehouse manager to develop a simulation system that demonstrates how orders are received, queued, processed, and dispatched in trucks. The warehouse handles three types of orders: Small (S) Medium (M) Bulk (B) Orders arrive randomly during the day. Each truck has a capacity of five orders. Once full, a truck is dispatched. The manager wants to see a clear simulation of how orders are queued, processed, and dispatched. Project Objective Using C++ and linear data structures (queues and stacks), develop a simulation that: Generates random orders without using external files. Assigns each order to a queue based on its type. Processes orders in first-in-first-out (FIFO) order for each queue. Uses stacks to represent dispatched trucks, showing last dispatched trucks on top (LIFO order). Tracks processing time for each order. Provides a record of all generated orders (time step, order type, processing time). Presents output clearly:: Queues with order types and processing times Dispatched trucks stack with numbering New arrivals at each time step Final table of all generated orders [To help you visualise the project - see the attached pseudocode] Simulation Details Queues Three queues represent each order type: S, M, B. Orders are added to the queue based on type. Each order has a processing time (randomly generated). Orders are processed in FIFO order. Trucks / Stack Each truck can hold 5 orders. Once full, the truck is dispatched. Dispatched trucks are placed in a stack, showing LIFO order. Each truck is numbered per type: Truck1[S], Truck2[M], Truck3[B], etc. Random Order Generation At each time step, 0–3 new orders arrive randomly. Each order type is chosen randomly. Each order is assigned a random processing time (1–4 time units). Output Format At each time step, display: New arrivals: list of order types arriving. Queue state: each queue with order types and remaining processing times. Stack of dispatched trucks: last dispatched on top with numbering. At the end of the simulation, display a table of all generated orders, in the format: time_step,type,processing_time 1,S,3 1,B,2 2,M,4 3,S,1 3,S,2 5,B,3 Example Expected Output (partial) Time Step 1: New Orders: S, B Queue S: [S(3)] Queue M: [] Queue B: [B(2)] Stack: empty Time Step 2: New Orders: M Queue S: [S(2)] Queue M: [M(4)] Queue B: [B(1)] Stack: empty Dispatched Trucks Stack (example at end): Top - Truck1[S] Truck1[B] Truck1[M] Bottom Final Generated Orders Table: time_step,type,processing_time 1,S,3 1,B,2 2,M,4 3,S,1 3,S,2 5,B,3 ... Technical and coding requirements Must use latest C++ standard (C++20 or later). Only standard libraries (iostream, queue, stack, vector, algorithm, etc.) are allowed. Submission Requirements Single C++ file only: _AS First three lines: student number and name. Must use latest C++ standard and standard libraries only. Output must follow format described above.
We specialize in providing a curated selection of university notes and assignments, meticulously crafted to aid students on their academic journey. Whether you're seeking comprehensive study materials or supplementary resources to enhance your learning, our store is your one-stop destination. Browse our collection and unlock the key to academic success, with quality content tailored to various disciplines and subjects. Empower your education with ease and efficiency at our store today.
Quality you can trust: written by students who passed their tests and reviewed by others who've used these notes.
No worries! You can instantly pick a different document that better fits what you're looking for.
No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.
“Bought, downloaded, and aced it. It really can be that simple.”