Reference no: EM133786427
Assignment: Advance Application Development XLS Group
For this assignment you are given three programs, each of which contains one or more errors. Your task is to correct each program so that it performs the desired behavior and document your findings.
Task
Your submission should contain a zip folder with the three corrected programs and a document that contains the following items for each program:
1) What is the problem with the program?
2) What solution did you implement?
3) Does your solution have any drawbacks or limitations? Explain why or why not.
Program I
This program plays the classic tile matching game. The object of the game is to find all the matching tiles by turning over two tiles at a time. If the colors match, the tiles are removed. If not, then the tiles are replaced and two more tiles are turned over. The game is over once all the matching colors have been found.
This implementation of the game allows the player to select the number of rows and columns of tiles. Unfortunately, this sometimes causes problems. The game currently runs without issue for the default number of rows and columns, however if the player chooses an odd number of rows and an odd number of columns, the game will crash.
Your task is to identify the cause of the crash and modify the game to both:
A. Prevent the game from crashing regardless of what values for rows and columns are entered (you may assume that both values will always be greater than 0)
B. Allow the game to be played successfully regardless of what values for rows and columns are selected.
The number of rows and columns may be selected by starting the game and selecting File -> Options
Program II
This program's purpose is to read in the associated text file containing 100000 values, sort them in descending order and count the number of duplicates. Unfortunately, the program does not execute properly and crashes.
Your task is to identify the number of duplicate values in the file. You may correct the existing code, or you may choose to refactor the whole program and reimplement it from scratch.
There should be 36874 duplicates values in the file.
Program III
This program's purpose is to iterate through a range of integer values and report if each value is prime or not. The program works and, as far as we know, produces correct answers. It is, however, slow...very slow.
Your task is to improve the performance of the program in any way possible. The program does include some benchmarking, so is should be easy to tell if your changes have made any improvement.