Skip to content

Sov3r3ign/Micro-Circuits

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

8 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿ”Œ Micro Circuits

Assignment

๐Ÿ“Š The system should keep track of stock codes, stock prices, and stock count in three separate lists. The stock codes should be string-based ๐Ÿ“, the prices floating-point ๐Ÿ’ฐ, and the count as integer ๐Ÿ”ข. To keep them competitive, their financial planner has advised them never to carry more than 50 types of stock (according to stock code) at a time ๐Ÿšซ๐Ÿ“ฆ.

โž• The system needs to have a function called AddStockCode() ๐Ÿท๏ธ. This function needs to prompt the user for a stock code and price and then add these values to the others already stored in the system ๐Ÿ—ƒ๏ธ. Their advisor has also requested that no item may be priced higher than R 1000.00 โš ๏ธ๐Ÿ’ธ.

๐Ÿ” To find a specific stock code, a search function is required. Create a function called SearchCode ๐Ÿงญ to fulfill this function. The function should receive a single string-based parameter, representing the stock code to search for ๐Ÿ”ก. The function must not do any unnecessary searching ๐Ÿš€. As soon as the search value is found, the search process should halt ๐Ÿ›‘. Upon a successful search, the function must return the index in the stock code list where the value was found ๐Ÿงฎ. If the value was not found, display a relevant message to the command-line and return a suitable value โŒ.

๐Ÿ“ฅ Once the stock codes and prices have been added, it will be necessary to add stock to the system. Create a function called AddStockItem ๐Ÿงพ which will prompt the user for a stock code and the number of items to add โž•๐Ÿ“ฆ. This function should make a call to the SearchCode function to find the relevant stock item ๐Ÿ”. To ensure that stock doesnโ€™t get old in the shop ๐Ÿ•ฐ๏ธ, their financial planner has advised them that they should never have more than 100 items of any stock type (according to stock count) in the shop at a time โš ๏ธ๐Ÿ“‰.

๐Ÿ“‹ From time to time, it will be necessary to check the stock list. Create a function called DisplayStockList ๐Ÿ–ฅ๏ธ which will display every stock code, with its associated price, number of items in stock, and total stock value for each item ๐Ÿ’น. The list should also display the total value of all stock in the system ๐Ÿ’ผ. The list should be displayed with a header in a format similar to the following:

Stock code, In stock, Price,Stock value AAA, 10,50,500 BBB,5,20.00,100 Total,,600

To control the system, Micro Circuits wish to make use of a CLI-based menu with the following options:

  1. Add Stock Code
  2. Add Stock Item
  3. Display Stock List
  4. Exit

The menu should display continuously until the user decides to exit the program, i.e. after selecting options 1 to 3 and completing the activity the menu should always be re-displayed. The program should only exit when option 4 is selected.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages