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

1. Write a fragment of code that checks a string variable to see if it contains

ID: 441881 • Letter: 1

Question

1. Write a fragment of code that checks a string variable to see if it contains your first name or not, and then prints either "that's me" or "that's not me" accordingly. Assume that the string variable aName has a valid string in it before the test is made. 2. Write a fragment of code that accepts integers from the user until a negative number is entered. The prompt should be "Enter a number (negative to quit):" Add up the numbers and print the sum (not including the negative number). Assume and use the following declarations: int sum = 0; int num; 3. Given the variables top, left, right, and bottom representing the coordinates of a rectangle's upper left and lower right corners, and variables ptX and ptY, representing the coordinates of a point, write a condition to test if the point is outside the rectangle. Assume that x increases to the right and that y increases to the top.

Explanation / Answer

please rate - thanks 1) in test program #include #include using namespace std; int main() {string name="My Name isdeportoifthatsok"; if(name.find("deporto",0)
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Chat Now And Get Quote