Answered step by step
Verified Expert Solution
Question
1 Approved Answer
1. To compile your program you can use the provided ./runit.sh script which in turn compiles program using g++ -g std=c++11 -Wall -Wextra -Wno-sign-compare
1. To compile your program you can use the provided ./runit.sh script which in turn compiles program using g++ -g std=c++11 -Wall -Wextra -Wno-sign-compare *.cpp, and only use create-output.sh script once all functionality is in place. 2. Our library can have a maximum of 10 Pokemon as set by static const int MAX = 10; 3. When you remove a Pokemon from the Pokedex, the order of the Pokemon in the Pokedex should stay the same. 4. When you print the Pokedex object, the output has to be as specified as in the test functions in main.cpp 5. If a Pokedex function gets an invalid parameter, such as trying to erase Pokemon at location -5, it should print an error message using cerr, but continue running. If the function needs to return a value, the return value is implementation dependent (you get to choose it) 6. The create-output.sh script compiles and runs your program with the command line parameters as follows: ./a.out test-1.txt test-2.txt test-3.txt non-existing-file.txt When testing you should run your program on different tests. 7. When the pokedex is empty, calling some functions such as front(), back(), at(int n), etc. still need to return a value. In those cases, you can return pokemons[0] 8. After you have completed a function, look at it one more time to see if it can be simplified. 9. Do not use this->unless it is needed for clarity 10. You can compare strings using '>'; you do not need to write your own function 11. Class methods are declared in the .h file and implemented in the .cpp file 12. Make sure you fix all the warnings produced by clang-format. You can set Visual Studio Code to "Format on Save" in Settings which will automatically fix your indentation problems. 13. You only need 1 line of documentation for each function. You can have more comments if (and only if) the additional comments are helping you read your code 14. When inserting a pokemon, you need to find the correct location alphabetically and then shift all the pokemon that come after it. You should not add the pokemon and sort the array each time. That is inefficient. 15. Take advantage of helper functions, such as empty()), in other functions instead of comparing msize to zero each time. 16. When removing a pokemon, you do not have to set the value in the array to ", you can leave the old value in place. 17. If you transfer your files from a Windows machine to CSS Linux lab, the runit.sh, create-output.sh and check-code- coverage.sh scripts can end up without execute permissions. To fix it, as well as fixing linefeed endings from Windows, use chmod 755 *.sh and dos2unix *.sh To prevent Filezilla from changing end-of-line character, set FileZilla 3.5.0 the setting in Edit > Settings > Transfers > File Types > Default transfer type > Binary. pokedex.cpp to implement the functions specified in pokedex.h. All functions in the .h and .cpp file have to be documented. 1-2 lines of documentation is usually sufficient. Uncomment the tests in main.cpp and pokedex-commands.cpp as you implement the functions Run create-output.sh script to create output.txt file
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started