Answer only with #include and using namespace std; Write a program whose input is a character and a string, a

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899604
Joined: Mon Aug 02, 2021 8:13 am

Answer only with #include and using namespace std; Write a program whose input is a character and a string, a

Post by answerhappygod »

Answer only with #include <iostream> and using namespace
std;
Write a program whose input is a character and a string, and
whose output indicates the number of times the character appears in
the string. The output should include the input character and use
the plural form, n's, if the number of times the characters appears
is not exactly 1.
Ex: If the input is:
the output is:
Ex: If the input is:
the output is:
Ex: If the input is:
the output is:
Case matters. n is different than N.
Ex: If the input is:
the output is:
The program must define and call the following function that
takes the input string and character as parameters, and returns the
number of times the input character appears in the input
string.
int CalcNumCharacters(string userString, char userChar)
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply