#include <iostream> #include <string> #include <cctype> #include <cstring> using
ID: 3654067 • Letter: #
Question
#include <iostream>
#include <string>
#include <cctype>
#include <cstring>
using namespace std;
int countA(char * str);
int main()
{
char city1[20] = "San Francisco";
char city2[20] = "Sonoma";
char city3[15] = "Lake Tahoe";
string sport1 = "Snowboard";
string sport2 = "Basketball";
string sport3 = "Baseball2Day";
string s4 = "catastrophe";
cout << "Test" << s4.find("phe",0) << endl;
//1. Write a c++ statment that prints any capital letter in city3
//2. Write a c++ statement that print's "yes" if there is a
//digit in the variable sport3"
//3. Write a c++ statement that compares
//city3 and city2 and prints "equal"
// if they are equal and "not equal" if they are not equal.
//4. Write a c++ statement that Appends the word "Tournament"
//to the variable sport2
//5. write a function that accepts a pointer to a C-string as
//its argument.
//The function should count the
//number of times the character 'w' occurs in the argument and return //that number
return 0;
}
Explanation / Answer
#include #include #include #include using namespace std; int countA(char * str); int main() { char city1[20] = "San Francisco"; char city2[20] = "Sonoma"; char city3[15] = "Lake Tahoe"; string sport1 = "Snowboard"; string sport2 = "Basketball"; string sport3 = "Baseball2Day"; string s4 = "catastrophe"; coutRelated Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.