Answered step by step
Verified Expert Solution
Link Copied!

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.
Followings are the execution examples.
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
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

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Design Query Formulation And Administration Using Oracle And PostgreSQL

Authors: Michael Mannino

8th Edition

1948426951, 978-1948426954

More Books

Students also viewed these Databases questions

Question

If f(x) = 4x - 7, find f -1 (x).

Answered: 1 week ago

Question

What are Measures in OLAP Cubes?

Answered: 1 week ago

Question

How do OLAP Databases provide for Drilling Down into data?

Answered: 1 week ago

Question

How are OLAP Cubes different from Production Relational Databases?

Answered: 1 week ago