Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

1. string s = “Weekly Assignment 4”; if(s.empty()) cout<<”Empty”; else cout<<”No

ID: 3667914 • Letter: 1

Question

1.

string s = “Weekly Assignment 4”;

if(s.empty())

cout<<”Empty”;

else

  cout<<”Not Empty”;

2.

string s = “Weekly Assignment 4”;

cout<<s.substr(1,7);

3.

string s = “Weekly Assignment 4”;

cout<<(s+”CMPSC101”);

4.

string s = “Weekly Assignment 4”;

s.replace(3,4,"pppp");

cout<<s;

5.

#include <iostream>

#include <string>

using namespace std;

int main()

{

   char c = 'F';

   

   if( (c >= 'E') && (c+1 == 'H') )

       cout<<"First condition satisfied";

   else if ( (c == 'G') || (c < 'T') )

       cout<<"Second condition satisfied";

   else if ( ((c != 'F') || (c < 'S')) && (c >= 'A') )

       cout<<"Third condition satisfied";

   else

       cout<<"None of the conditions were satisfied";

   

   return 0;

}

Explanation / Answer

1.

Not Empty

2.
Weekly

3.
Weekly Assignment 4CMPSC101

4.
WeeppppAssignment

5.
Third condition satisfied

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Chat Now And Get Quote