Write a function named “HasTheSameEndingChar” that accepts 2 parameters the same as command line arguments (argc and argv). It will return true if command line arguments that has the same ending character. If the user has provided no argument or only one argument, it will also return true. If any of the arguments does not end with same character, it will return false. This function should not have cin or cout. This function cannot use string class, either. Write a complete C++ program that accepts command line arguments and call the above function. It will print out “Yes” if the function returns true and “No” if it returns false. Important requirement:  This program cannot include header file and cannot use string class and its methods such as “length” or “size”  This program requires only the use of array, C-string and pointers No global variable is allowed to be declared and used     For example, the following runs will print Yes, Yes, Yes, Yes, No, No, No and No. HasTheSameEndingChar HasTheSameEndingChar One HasTheSameEndingChar One Three HasTheSameEndingChar One Three Nine HasTheSameEndingChar One Two HasTheSameEndingChar One Three Two HasTheSameEndingChar One Two Three HasTheSameEndingChar One Three Nine Te

C++ for Engineers and Scientists
4th Edition
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Bronson, Gary J.
Chapter6: Modularity Using Functions
Section6.2: Returning A Single Value
Problem 13E
icon
Related questions
Question

Write a function named “HasTheSameEndingChar” that accepts 2
parameters the same as command line arguments (argc and argv). It will return true if command line arguments that has the same ending character. If the user has provided no argument or only one argument, it will also return true. If any of the arguments does not end with same character, it will return false. This function should not have cin or cout. This function cannot use string class, either.

Write a complete C++ program that accepts command line arguments and call the above function. It will print out “Yes” if the function returns true and “No” if it returns false.

Important requirement: 

This program cannot include header file and cannot use string class and its methods such as “length” or “size” 

This program requires only the use of array, C-string and pointers

No global variable is allowed to be declared and used

 

 

For example, the following runs will print Yes, Yes, Yes, Yes, No, No, No
and No.
HasTheSameEndingChar
HasTheSameEndingChar One
HasTheSameEndingChar One Three
HasTheSameEndingChar One Three Nine
HasTheSameEndingChar One Two
HasTheSameEndingChar One Three Two
HasTheSameEndingChar One Two Three
HasTheSameEndingChar One Three Nine Ten

Expert Solution
Step 1

Actually, given information:

Important requirement: 

This program cannot include header file and cannot use string class and its methods such as “length” or “size” 

This program requires only the use of array, C-string and pointers

No global variable is allowed to be declared and used

trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 4 steps with 2 images

Blurred answer
Knowledge Booster
Datatypes
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr