O Main.java Write code that will take in a String input and check to see if it is a palindrome or not. 3 Main.java 1 imp

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899604
Joined: Mon Aug 02, 2021 8:13 am

O Main.java Write code that will take in a String input and check to see if it is a palindrome or not. 3 Main.java 1 imp

Post by answerhappygod »

O Main Java Write Code That Will Take In A String Input And Check To See If It Is A Palindrome Or Not 3 Main Java 1 Imp 1
O Main Java Write Code That Will Take In A String Input And Check To See If It Is A Palindrome Or Not 3 Main Java 1 Imp 1 (45.48 KiB) Viewed 46 times
O Main.java Write code that will take in a String input and check to see if it is a palindrome or not. 3 Main.java 1 import java.util.Scanner; 2 class Main public static void main(String[] args) { Scanner inp = new Scanner(System.in); System.out.print("In:"); String s = inp.nextLine(); 8 //write your code below 3 4 A palindrome means that the characters are the same forwards and backwards, ignoring spaces. 5 6 7 Examples of palindromes: 9 racecar was it a car or a cat I saw 10 11 12 } never odd or even } • rats live on no evil star Your check should be case insensitive too. For example, "Bob" is a palindrome, despite the first B being capitalized | Your program will print out "true" if it's a palindrome and "false" if not. -
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply