Answer:
#include <iostream>
#include <array>
using namespace std;
bool isPalindrome(string str)
{
int length = str.length();
for (int i = 0; i < length / 2; i++)
if (toupper(str[i]) != toupper(str[length - 1 - i]))
return false;
return true;
}
int main()
{
array<string, 6> tests = { "madam", "abba", "22", "67876", "444244", "trymEuemYRT" };
for (auto test : tests) {
cout << test << " is " << (isPalindrome(test) ? "" : "NOT ") << "a palindrome.\n";
}
}
Explanation:
The toupper() addition forces characters to uppercase, thereby making the comparison case insensitive.
Answer:
The correct answer for the given question is Integer.parseInt( string variable );
Explanation:
Integer.parseInt( string variable ); is the method in a java programming language that convert the string into the integer value. It takes a string variable and converted into the integer.
Following are the program in java which convert the string value into an integer value.
class Main
{
public static void main(String []args) // main function
{
String str1 = "10009";
// variable declaration
int k = Integer.parseInt(str1);
// convert the string into integer.
System.out.println("Converted into Int:" + k);
}
}
Output:
Converted into Int:10009
Convert.toInt( stringVariable );
Convert.parseInt( stringVariable,Integer.toInt( stringVariable ); are not any method to convert the string into integer .
Therefore the correct answer is :Integer.parseInt( stringVariable );
Answer:
i would but im not big brain
Explanation:
Put the mouse at the top of the black part and click and hold down, and then drag it down to the bottom. And don't feel embarrassed to ask somebody lol