Answered step by step
Verified Expert Solution
Question
1 Approved Answer
13. Write a function named placeStringtocolumn that takes a place-string as its only parameter and returns the column number as an int. If the place-string
13. Write a function named placeStringtocolumn that takes a place-string as its only parameter and returns the column number as an int. If the place-string has no characters, return INVALID_COORDINATE. If the first character in the place-string is not a letter or if it is either 'I' or ' O ', then return INVALID_COORDINATE. - Reminder: In a well-formed place-string, the column is specified by the first character. If the first character is ' A ' then the column number is 0 ; if the first character is ' B ' then the column number is 1 ; and so forth. - Reminder: The characters ' I' and ' O ' cannot appear in a well-formed place-string. ' H ' indicates column 7 while ' J ' indicates column 8. Similarly, ' N ' indicates column 12 while ' P ' indicates column 13. 14. Add code to your main function to test your placeStringTocolumn function on at least 3 different place-strings, including at least one with an invalid column. Print similar messages as for the other tests. 15. Write a function named isPlacestringWellFormed that take a place-string as its only parameter and returns a bool indicating whether the place-string is well-formed. - Hint: Use your placeStringToRow and placestringTocolumn functions. If either returns INVALID_COORDINATE, the place-string is ill-formed. 16. Add code to your main function to test your isPlaceStringWellFormed function on at least 3 different place-strings. Include at one with a well-formed string, one with an invalid row, and one with an invalid column. 17. Rename your main. cpp file to mainA. cppx. Do not delete or overwrite it; you will have to hand it in
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