Objective :Transform the single combined source code below into the more standar
ID: 3580940 • Letter: O
Question
Objective:Transform the single combined source code below into the more standard separated .h and .cpp source files. Determine which #includes are needed for each file. Find and fix errors where C++ can not find symbols because of namespace/scope issues. Get the complete program compiled and running correctly.
Requirements: Work on this project in a new, empty directory/folder. Start with the source code. Break the code into separate source code files. There should be six files when you are done (Type.h, Ship.h, Ship.cpp, Quadrant.h, Quadrant.cpp, and Trek.cpp). Header files are required to include header guards and should not have any code implementation, just class or enum declarations. Header files should #include all the files that the associated implementation file will need to get its tasks done. Source files other than the one with the main function should only #include their associated header file. Try to compile the program using all the .cpp source files.
Correct the errors by doing the following: Add the appropriate #include statements to each file as needed (but no extra #includes), fix any header guard problems that you have in the code, add namespace/scope information to statements as needed so C++ can find the appropriate methods or fields.
Code:
Sample Run:
Explanation / Answer
Sample Run:
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.