Answer:
public static boolean isPalindrome(String word) {
//TODO: Complete this method
String reverse = "";
for (int i = (word.length()-1); i>=0; i--) {
if(word.charAt(i)!=' '){
reverse+=word.charAt(i);
}
}
String without_space = word.replaceAll(" ", "");
return reverse.equals(without_space);
}
Answer:
I've implemented this program using python
userinput = int(input("Length: "))
mylist = []
mylist.append(userinput)
for i in range(1,userinput+1):
userinp = int(input("Input: "))
mylist.append(userinp)
smallval = mylist[1]
for i in range(1,len(mylist)):
if smallval > mylist[i]:
smallval = mylist[i]
for i in range(1,len(mylist)):
mylist[i] = mylist[i] - smallval
for i in range(1,len(mylist)):
print(mylist[i],end=' ')
Explanation:
I've added the full source program as an attachment where I used comments to explain difficult lines
Answer:
portability and simplicaity are the featues of napier bones
#2: Portrait taller than wide & landscape wider than tall