| about | help | code help+videos | done | prefs |
apcsaPrimitivesIntPalindrome
Given an int, determine if its base-10 representation (as a String) is a palindrome. A palindrome reads the same forwards and backward. The sign (-) is part of the representation and should be considered. HINT: checking for a palindrome involves a loop, usually. If you haven't learned loops yet you can skip this problem. Or, there is a class called StringBuilder (not on the exam, but quite useful sometimes and part of java.lang) which has a constructor accepting a String, a handy reverse method and a toString that outputs its contents.apcsaPrimitivesIntPalindrome(121) → true apcsaPrimitivesIntPalindrome(123) → false apcsaPrimitivesIntPalindrome(5) → true ...Save, Compile, Run (ctrl-enter) |
Progress graphs:
Your progress graph for this problem
Random user progress graph for this problem
Random Epic Progress Graph
Difficulty: 130
Copyright Nick Parlante 2017 - privacy