Hello..I am Sahil Jayasingh, 1st Year Student at Manipal University Jaipur(B.Tech CSE Core)
This is a readme file for the problem set (Stocks) modified and debugged by me. The Program is running
I have attached the program and output along with this
#Syntax and Runtime error fix line 9 -> #{Syntax Error: missing colon} For defining a function, colon is a must as it is in the Syntax line 17 -> #{Runtime Error: list uses append } In order to add new element in a list, we use the append command
#Logical Error line 5 -> #{Logical : 999.99 was in string) If it was in string, it would print thrice instead of adding ex- 999.99999.99999.99 line 15 -> #{Logical : we weren't adding up the values) It was just overwriting with new values. The old values were lost line 16 -> #{Logical : For out of stock items, we should check Quantity) Previously, we were checking with stock_value which had no correlation with being out of stock
#Added fix line 13 -> #to keep a eye on the -1 qty in stock A check to prevent the flow of the negative stock quantity (p006) i.e.stock_value with -1 being added into total_value line 15 -> #{Logical : we weren't adding up the values) Used assignment operator(+=) instead of overwriting the new values which hampered the total and gave a wrong answer
line 7 -> #{Good Practice ! : removal of extra comma }
Although python does not throw an error upon adding the comma at end as it is accepted but removing it is just a good programming practice