Practice

Stock Reorder List

MEDIUMArrays8 marks

Read five product names and their stock quantities into parallel arrays.

For every product with stock less than 10, output the product name. After checking all products, output the number of products that need reordering.

Input: Five pairs: product name, then stock quantity. Output: Product names below 10, then Total: followed by the reorder count.

Example:

Input:  Pens
        4
        Books
        12
        Rulers
        9
        Bags
        10
        Glue
        2
Output: Pens
        Rulers
        Glue
        Total: 3
Premium is coming soon. All grading features are currently unlocked.

Sample Test Cases

Test 1: Some products below reorder level
Inputs: Pens, 4, Books, 12, Rulers, 9, Bags, 10, Glue, 2
Expected: Pens Rulers Glue Total: 3
Test 2: No products below 10
Inputs: A, 10, B, 11, C, 12, D, 13, E, 14
Expected: Total: 0