QUESTION 3 (7 MARKS)
The following algorithm has been implemented as an LMC program, however, the program does not behave as expected. A part of your task is to debug the program so that the implementation matches the algorithm. You must describe the change(s) that you make and provide clarity as to why you made them/it. Provide a test suite to demonstrate that the fixes are correct. Hint: the changes required are small. Do not rewrite the entirety or sections of the code.
CountitemsGreaterThanX n 4— user-specified number of items x user-specified value for X c 4- count of items greater than X while n is greater than 0 m 4—user-specified item if m ) x c = c 1 n = n – 1 Display the count, c
Below is the code. Unfortunately, the developer has not indented or commented their code, so readability is low. A part of your task is to tidy and comment the code. The LMC code is available on Blackboard as “Question3.txt”, and is below for your own reference. It is strongly recommended that you do not copy and paste from here as Office Word is known for incorrectly formatting code; you should use the code available on Blackboard.
- Assignment status: Already Solved By Our Experts
- (USA, AUS, UK & CA PhD. Writers)
- CLICK HERE TO GET A PROFESSIONAL WRITER TO WORK ON THIS PAPER AND OTHER SIMILAR PAPERS, GET A NON PLAGIARIZED PAPER FROM OUR EXPERTS