Write a function which takes two string variables not c


Question: Write a function which takes two string variables not C strings as inputs and compares them. If they are equal, the function should return 0. If the first-string is less than the second string, return a negative number. If the first string is greater than the second string, return a positive number.

You are not allowed to use the compare method of the string data type. You must use the comparison operators. Do not write a main function. Your function does not do any cout or cin.

Be sure to properly format all your code. Add comments to your code.

Request for Solution File

Ask an Expert for Answer!!
JAVA Programming: Write a function which takes two string variables not c
Reference No:- TGS0957788

Expected delivery within 24 Hours