A program sorts string data using different sorting methods. The function CompareStrings(): - takes two strings as parameters - compares each string, one character at a time, to identify which string comes first alphabetically. If the first two characters are the same, the second character of each string is compared. This continues until the two characters are different. The function: - returns 1 if the first parameter comes before the second alphabetically - returns 2 if the second parameter comes before the first alphabetically. Write program code for CompareStrings(). Assume that all strings are in lower case. Assume that a difference between two strings will always be identified before the end of one string is reached. Do not use an in-built string comparison function. The strings must be compared one character at a time. Save your program. Copy and paste the program code into part 1(c) in the evidence document.
Exam No:9618_w24_qp_43 Year:2024 Question No:1(c)
Answer:


Knowledge points:
19.1 Algorithms
20.1 Programming Paradigms
Solution:
Download APP for more features
1. Tons of answers.
2. Smarter Al tools enhance your learning journey.
IOS
Download
Download
Android
Download
Download
Google Play
Download
Download