Question: The two header files a.h and b.h both have a prototype for a single function. Both have at least two mistakes. Fix the mistakes so

 The two header files a.h and b.h both have a prototypefor a single function. Both have at least two mistakes. Fix the

The two header files a.h and b.h both have a prototype for a single function. Both have at least two mistakes. Fix the mistakes so that the tester program works correctly. Complete the following files: a.h 1 #ifndef A_H 2 #define A_H 3 #include 4 5 /** 6 Converts a character into the corresponding string form. 7 For example, calling charToString('Q') returns the string "Q". 8 @param c the character to convert. 9 @return the string form of the character. 10 */ 11 std::string charToString(char c)|| 12 { 13 return std::string(1,c); 14 } 15 #endif b.h 1 #ifndef B_H 2 #define B_H 3 #include 4 /** 5 Returns a string version of the bool argument. 6 @param b the Boolean value to convert 7 @return "true" or "false" 8 */ std::string boolToString(bool b) 10 { 11 if(b) 12 return "true"; 13 return "false"; 14 } 15 16 #endif 9 header guards written for a. h Expected: header guards written for a. h Header file ah has NO using namespace directive, Expected: Header file a. h has NO using namespace directive. string library type in a. h IS fully qualified. Expected: string library type in a. h Is fully qualified. header guards written for b.h Expected: header guards written for b.h Header file b.h has NO using namespace directive. Expected: Header file b.h has NO using namespace directive. string library type in b.h IS fully qualified. Expected: string library type in b.h Is fully qualified, Running Tester2.cpp Error: /tmp/codecheck. ab4t8D04sb/Tester2.cpp: In function 'int main()': /tmp/codecheck. ab4t8D04sb/Tester2.cpp:8:56: error: 'boolToString' was not declared in this scope cout using namespace std; #include "ah" int main() { cout

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!