V velvetred Eternal Poster Joined May 4, 2022 Posts 709 Solutions 18 Reaction 1,253 Points 416 May 25, 2022 #1 Attachments You do not have permission to view the full content of this post. Log in or register now. Last edited: May 25, 2022
A Aoshinomori Addict May 26, 2022 #4 C++: #include <iostream> #include <string> using namespace std; string Str1, Str2; void DisplayTheTwoStrings() { cout << endl << Str1; cout << endl << Str2; } void DisplayLengthOfTwoStrings() { cout << endl << "Length of string1: " << Str1.length(); cout << endl << "Length of string2: " << Str2.length(); } void ConnectString1ToString2() { cout << endl << Str2 << Str1; } void ChangeString1ToLowerCase() { for (int x = 0; x < Str1.length(); x++) { Str1[x] = tolower(Str1[x]); } cout << endl << Str1; } void ChangeString2ToUpperCase() { for (int x = 0; x < Str2.length(); x++) { Str2[x] = toupper(Str2[x]); } cout << endl << Str2; } int main() { cout << "Enter string 1: "; getline (cin,Str1); cout << endl << "Enter string 2: "; getline (cin, Str2); DisplayTheTwoStrings(); DisplayLengthOfTwoStrings(); ConnectString1ToString2(); ChangeString1ToLowerCase(); ChangeString2ToUpperCase(); }
C++: #include <iostream> #include <string> using namespace std; string Str1, Str2; void DisplayTheTwoStrings() { cout << endl << Str1; cout << endl << Str2; } void DisplayLengthOfTwoStrings() { cout << endl << "Length of string1: " << Str1.length(); cout << endl << "Length of string2: " << Str2.length(); } void ConnectString1ToString2() { cout << endl << Str2 << Str1; } void ChangeString1ToLowerCase() { for (int x = 0; x < Str1.length(); x++) { Str1[x] = tolower(Str1[x]); } cout << endl << Str1; } void ChangeString2ToUpperCase() { for (int x = 0; x < Str2.length(); x++) { Str2[x] = toupper(Str2[x]); } cout << endl << Str2; } int main() { cout << "Enter string 1: "; getline (cin,Str1); cout << endl << "Enter string 2: "; getline (cin, Str2); DisplayTheTwoStrings(); DisplayLengthOfTwoStrings(); ConnectString1ToString2(); ChangeString1ToLowerCase(); ChangeString2ToUpperCase(); }
V velvetred Eternal Poster May 26, 2022 TS TS #5 Aoshinomori said: C++: #include <iostream> #include <string> using namespace std; string Str1, Str2; void DisplayTheTwoStrings() { cout << endl << Str1; cout << endl << Str2; } void DisplayLengthOfTwoStrings() { cout << endl << "Length of string1: " << Str1.length(); cout << endl << "Length of string2: " << Str2.length(); } void ConnectString1ToString2() { cout << endl << Str2 << Str1; } void ChangeString1ToLowerCase() { for (int x = 0; x < Str1.length(); x++) { Str1[x] = tolower(Str1[x]); } cout << endl << Str1; } void ChangeString2ToUpperCase() { for (int x = 0; x < Str2.length(); x++) { Str2[x] = toupper(Str2[x]); } cout << endl << Str2; } int main() { cout << "Enter string 1: "; getline (cin,Str1); cout << endl << "Enter string 2: "; getline (cin, Str2); DisplayTheTwoStrings(); DisplayLengthOfTwoStrings(); ConnectString1ToString2(); ChangeString1ToLowerCase(); ChangeString2ToUpperCase(); } Click to expand... thank you po
Aoshinomori said: C++: #include <iostream> #include <string> using namespace std; string Str1, Str2; void DisplayTheTwoStrings() { cout << endl << Str1; cout << endl << Str2; } void DisplayLengthOfTwoStrings() { cout << endl << "Length of string1: " << Str1.length(); cout << endl << "Length of string2: " << Str2.length(); } void ConnectString1ToString2() { cout << endl << Str2 << Str1; } void ChangeString1ToLowerCase() { for (int x = 0; x < Str1.length(); x++) { Str1[x] = tolower(Str1[x]); } cout << endl << Str1; } void ChangeString2ToUpperCase() { for (int x = 0; x < Str2.length(); x++) { Str2[x] = toupper(Str2[x]); } cout << endl << Str2; } int main() { cout << "Enter string 1: "; getline (cin,Str1); cout << endl << "Enter string 2: "; getline (cin, Str2); DisplayTheTwoStrings(); DisplayLengthOfTwoStrings(); ConnectString1ToString2(); ChangeString1ToLowerCase(); ChangeString2ToUpperCase(); } Click to expand... thank you po
A Aoshinomori Addict May 26, 2022 #6 Mali pala yung sa letter C dapat ganito C++: void ConnectString1ToString2() { Str2 = Str2 + Str1; cout << endl << Str2; }
Mali pala yung sa letter C dapat ganito C++: void ConnectString1ToString2() { Str2 = Str2 + Str1; cout << endl << Str2; }
V velvetred Eternal Poster May 26, 2022 TS TS #7 Patulong po ulit C language po ito Input a sentence. Display each word and determine the length of each word
Patulong po ulit C language po ito Input a sentence. Display each word and determine the length of each word
A Aoshinomori Addict May 27, 2022 #8 C++: #include<iostream> #include<string> #include<sstream> #include<vector> using namespace std; int main() { string Input, buf; vector<string> words; cout << "Enter sentence: "; getline(cin, Input); stringstream ss(Input); while (ss >> buf) { words.push_back(buf); } for (int i = 0; i < words.size(); i++) { cout << endl << words[i] << " [length: " << words[i].length() <<"]"; } getchar(); }
C++: #include<iostream> #include<string> #include<sstream> #include<vector> using namespace std; int main() { string Input, buf; vector<string> words; cout << "Enter sentence: "; getline(cin, Input); stringstream ss(Input); while (ss >> buf) { words.push_back(buf); } for (int i = 0; i < words.size(); i++) { cout << endl << words[i] << " [length: " << words[i].length() <<"]"; } getchar(); }
V velvetred Eternal Poster May 27, 2022 TS TS #9 Aoshinomori said: C++: #include<iostream> #include<string> #include<sstream> #include<vector> using namespace std; int main() { string Input, buf; vector<string> words; cout << "Enter sentence: "; getline(cin, Input); stringstream ss(Input); while (ss >> buf) { words.push_back(buf); } for (int i = 0; i < words.size(); i++) { cout << endl << words[i] << " [length: " << words[i].length() <<"]"; } getchar(); } Click to expand... thank you po
Aoshinomori said: C++: #include<iostream> #include<string> #include<sstream> #include<vector> using namespace std; int main() { string Input, buf; vector<string> words; cout << "Enter sentence: "; getline(cin, Input); stringstream ss(Input); while (ss >> buf) { words.push_back(buf); } for (int i = 0; i < words.size(); i++) { cout << endl << words[i] << " [length: " << words[i].length() <<"]"; } getchar(); } Click to expand... thank you po