Company: Infosystems

Difficulty: medium

Problem Statement

Parcel Management System Simulator Implement a small parcel-management system. Each parcel receives the next available identifier, starting at `1`. A parcel stores the sender name, recipient name, destination address, weight, and delivery status. The address is printed in the format `street, city, state zipCode`. Input Format The first line contains an integer `Q`, the number of commands. - `ADD sender recipient street city state zipCode weight` creates a parcel. All names and address parts are single non-space tokens. The new parcel has status `Pending`. - `UPDATE id status` changes the status of an existing parcel. `status` is one of `Pending`, `InTransit`, or `Delivered`. - `SHOW id` prints the details of an existing parcel. Every `id` used by `UPDATE` or `SHOW` refers to a parcel that has already been added. Output Format For each `SHOW id` command, print exactly: `Parcel <id>: <sender> -> <recipient>, <street>, <city>, <state> <zipCode>

More Infosystems OA questionsInterview experiences