Huawei OD machine test-automatic vending system (C++ & Java & JS & Python)

describe

1 General description

Candidates need to simulate the implementation of a simple automatic vending system to realize the functions of inserting coins, purchasing goods, returning coins, and querying inventory goods and money box information.

When the system is initialized, there are 6 types of products in the vending machine. For the unit price of the products, please refer to 1.1 specifications. 1 yuan, 2 yuan, 5 yuan, and 10 yuan coins are placed in the money box. The number of products and the number of coins are set through the initialization command. See 2.1 System Initialization.

1.1 Specifications

1. Commodity: Each commodity contains three attributes: product name, unit price, and quantity. The product name is not repeated. Candidates cannot modify the product name and unit price, and the initialization command sets the product quantity. This information is defined in the exam framework and can be used directly by candidates when implementing functional code.

Product  name

unit price

quantity

A1 2 X
A2 3 X
A3 4

Guess you like

Origin blog.csdn.net/m0_68036862/article/details/132895652