diff options
| author | [email protected] <[email protected]> | 2021-11-02 23:29:40 -0700 |
|---|---|---|
| committer | [email protected] <[email protected]> | 2021-11-02 23:29:40 -0700 |
| commit | 1013a6ec15128b714af8be5ed21bc8e09763ac68 (patch) | |
| tree | 20c1a540054970310d21ba8d7e012f025c0e52a6 | |
| parent | LAB5 ANSWERS ANSARI v3 (diff) | |
| download | cst116-lab5-rayyanansari03-1013a6ec15128b714af8be5ed21bc8e09763ac68.tar.xz cst116-lab5-rayyanansari03-1013a6ec15128b714af8be5ed21bc8e09763ac68.zip | |
LAB5Ansari- Answers V4
| -rw-r--r-- | LAB5-Ansari-Answers.txt | 66 |
1 files changed, 66 insertions, 0 deletions
diff --git a/LAB5-Ansari-Answers.txt b/LAB5-Ansari-Answers.txt index 35dbb69..2199035 100644 --- a/LAB5-Ansari-Answers.txt +++ b/LAB5-Ansari-Answers.txt @@ -412,6 +412,72 @@ Break into at least 3 files as in 9b. 10 pts #7 Write a full program to do this. Submit: code & runs +FILE 1 (MAIN) + +#include "CommonInfo.h" + + + + +int main() +{ + char string1[] = {"Frank"}; + char string2[] = { "Franklyn" }; + + + + + + if (checkIfEqual(string1, string2)) { + + cout << "Same"; + + + } + else { + + cout << "Different"; + + } + + +} + +FILE 2 (Functions) + +#include "CommonInfo.h" + +bool checkIfEqual(char string1[], char string2[]) { + + for (int x = 0; x < 6; x++) { + + if (string1[x] != string2[x]) { + + + return false; + + } + + } + return true; + +} + + +FILE 3(Header) + +#include <iostream> +using namespace std; +const int NUMSTUDENTS = 10; +const int NUMGRA = 5; +bool checkIfEqual(char string1[], char string2[]); + +OUTPUT: + +Different +C:\Users\ansar\source\repos\LAB5 - Ansari - FIXED\Debug\LAB5 - Ansari - FIXED.exe (process 18420) exited with code 0. +To automatically close the console when debugging stops, enable Tools->Options->Debugging->Automatically close the console when debugging stops. +Press any key to close this window . . . |