• Wrong document? Swap it for free
  • Written by students who passed
  • Immediately available after payment
  • Read online or as PDF
Sell
Where do you study
Your language
Document preview thumbnail
Preview 1 out of 18 pages
Other

Cos2611 Assignment 1 Solutions for 2026

Document preview thumbnail
Preview 1 out of 18 pages

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.

Content preview

COS2611 ASSIGNMENT 1 2026 SOLUTION


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.

Document information

Uploaded on
May 13, 2026
Number of pages
18
Written in
2025/2026
Type
Other
Person
Unknown
R119,33

Wrong document? Swap it for free Within 14 days of purchase and before downloading, you can choose a different document. You can simply spend the amount again.
Written by students who passed
Immediately available after payment
Read online or as PDF

Seller avatar
Reputation scores are based on the amount of documents a seller has sold for a fee and the reviews they have received for those documents. There are three levels: Bronze, Silver and Gold. The better the reputation, the more your can rely on the quality of the sellers work.
IntellectInn
5,0
(4)
Sold
29
Followers
4
Items
45
Last sold
1 month ago



Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their exams and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can immediately select a different document that better matches what you need.

Pay how you prefer, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card or EFT and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Working on your references?

Create accurate citations in APA, MLA and Harvard with our free citation generator.

Working on your references?

Frequently asked questions