Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Please implement the inventry control system by using Apache. Followings are the execution examples. Below are the functions implemented for /stocker (1) Addition of inventory
Please implement the inventry control system by using Apache.
Below are the functions implemented for /stocker (1) Addition of inventory argument: . function (required): addstock o name (required): Specify the name of the target product. o amount (arbitrary): Specify the number (positive integer) to add the target product to the inventory. The default is 1. Output: None (2) Inventory check argument: function (required): checkstock o name (optional): Specify the name of the target product. Output: . If a name is specified, the number of items in stock with that name is output in the "[name]: [amount]" format. When there is no stock, amount is displayed as 0. When name is not specified, the number of stocks of all products is sorted in ascending order with name as a key and output. Items with O inventory are not displayed. . Example output: O xXx: 12 Wy: 7 (3) Sales argument: function (required): sell o name (required): Specify the name of the target product o amount (arbitrary): Specify the number (a positive integer) of the target product sold. The default is 1. price (optional): Specify the price of the target product (a number greater than o). Only when input, add price x amount to sales. Output: None . (4) Sales check argument: function (required): checksales Output: Displays the current sales in the format "sales: (sales)". For decimal numbers, round up to the second decimal place. Example output: sales: 400 (5) Delete all argument: function (required): deleteall Output: None /stocker o running below returns xxx: 96 $ curl "http://1.2.3.4:8080/stocker?function=deleteall" $ curl "http://1.2.3.4:8080/stocker?function-addstock&name=xxx&amount=100" $ curl "http://1.2.3.4:8080/stocker?function=sell&name=xxx&amount=4" $ curl "http://1.2.3.4:8888/stocker?function=checkstock&name=xxX" o running below returns xxx: 96 yyy: 100 YYY: 100 $ curl "http://1.2.3.4:8080/stocker?function=addstock&name=yyy&amount=100" $ curl "http://1.2.3.4:8080/stocker?function=addstock&name=YYY&amount=100" $ curl "http://1.2.3.4:8080/stocker?function=checkstock" $ curl "http://1.2.3.4:8080/stocker?function=deleteall" $ curl "http://1.2.3.4:8080/stocker?function=addstock&name=xxx&amount=100" $ curl "http://1.2.3.4:8080/stocker?function=sell&name=xxx&amount=4" $ curl "http://1.2.3.4:8080/stocker?function=checkstock&name=xxx" XXX: 96 $ curl "http://1.2.3.4:8080/stocker?function=addstock&name=yyy&amount=100" $ curl "http://1.2.3.4:8080/stocker?function=addstock&name=YYY&amount=100" $ curl "http://1.2.3.4:8080/stocker?function=checkstock" YYY: 100 XXX: 96 yyy: 100 $ curl "http://1.2.3.4:8080/stocker?function=deleteall" $ curl "http://1.2.3.4:8080/stocker?function=addstock&name=xxx&amount=1.1" ERROR $ curl "http://1.2.3.4:8080/stocker?function=deleteall" $ curl "http://1.2.3.4:8080/stocker?function=addstock&name=aaa&amount=10" $ curl "http://1.2.3.4:8080/stocker?function=addstock&name=bbb&amount=10" $ curl "http://1.2.3.4:8080/stocker?function=sell&name=aaa&amount=4&price=100" $ curl "http://1.2.3.4:8080/stocker?function=sell&name=aaa&price=80" $ curl "http://1.2.3.4:8080/stocker?function=checkstock&name=aaa" aaa: 5 $ curl "http://1.2.3.4:8080/stocker?function=checksales" sales: 480 Below are the functions implemented for /stocker (1) Addition of inventory argument: . function (required): addstock o name (required): Specify the name of the target product. o amount (arbitrary): Specify the number (positive integer) to add the target product to the inventory. The default is 1. Output: None (2) Inventory check argument: function (required): checkstock o name (optional): Specify the name of the target product. Output: . If a name is specified, the number of items in stock with that name is output in the "[name]: [amount]" format. When there is no stock, amount is displayed as 0. When name is not specified, the number of stocks of all products is sorted in ascending order with name as a key and output. Items with O inventory are not displayed. . Example output: O xXx: 12 Wy: 7 (3) Sales argument: function (required): sell o name (required): Specify the name of the target product o amount (arbitrary): Specify the number (a positive integer) of the target product sold. The default is 1. price (optional): Specify the price of the target product (a number greater than o). Only when input, add price x amount to sales. Output: None . (4) Sales check argument: function (required): checksales Output: Displays the current sales in the format "sales: (sales)". For decimal numbers, round up to the second decimal place. Example output: sales: 400 (5) Delete all argument: function (required): deleteall Output: None /stocker o running below returns xxx: 96 $ curl "http://1.2.3.4:8080/stocker?function=deleteall" $ curl "http://1.2.3.4:8080/stocker?function-addstock&name=xxx&amount=100" $ curl "http://1.2.3.4:8080/stocker?function=sell&name=xxx&amount=4" $ curl "http://1.2.3.4:8888/stocker?function=checkstock&name=xxX" o running below returns xxx: 96 yyy: 100 YYY: 100 $ curl "http://1.2.3.4:8080/stocker?function=addstock&name=yyy&amount=100" $ curl "http://1.2.3.4:8080/stocker?function=addstock&name=YYY&amount=100" $ curl "http://1.2.3.4:8080/stocker?function=checkstock" $ curl "http://1.2.3.4:8080/stocker?function=deleteall" $ curl "http://1.2.3.4:8080/stocker?function=addstock&name=xxx&amount=100" $ curl "http://1.2.3.4:8080/stocker?function=sell&name=xxx&amount=4" $ curl "http://1.2.3.4:8080/stocker?function=checkstock&name=xxx" XXX: 96 $ curl "http://1.2.3.4:8080/stocker?function=addstock&name=yyy&amount=100" $ curl "http://1.2.3.4:8080/stocker?function=addstock&name=YYY&amount=100" $ curl "http://1.2.3.4:8080/stocker?function=checkstock" YYY: 100 XXX: 96 yyy: 100 $ curl "http://1.2.3.4:8080/stocker?function=deleteall" $ curl "http://1.2.3.4:8080/stocker?function=addstock&name=xxx&amount=1.1" ERROR $ curl "http://1.2.3.4:8080/stocker?function=deleteall" $ curl "http://1.2.3.4:8080/stocker?function=addstock&name=aaa&amount=10" $ curl "http://1.2.3.4:8080/stocker?function=addstock&name=bbb&amount=10" $ curl "http://1.2.3.4:8080/stocker?function=sell&name=aaa&amount=4&price=100" $ curl "http://1.2.3.4:8080/stocker?function=sell&name=aaa&price=80" $ curl "http://1.2.3.4:8080/stocker?function=checkstock&name=aaa" aaa: 5 $ curl "http://1.2.3.4:8080/stocker?function=checksales" sales: 480 Followings are the execution examples.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started