Java Program - Functions With Parameters and No Return Values Create a function named palindrome that asks the user a string input if called. If the string is a palindrome, print “{input} is a palindrome!”, otherwise print “{input} is not a palindrome!”.   In the main function, call the palindrome function. Input 1. One line containing a single string Output Enter a string: racecar racecar is a palindrome!

Microsoft Visual C#
7th Edition
ISBN:9781337102100
Author:Joyce, Farrell.
Publisher:Joyce, Farrell.
Chapter8: Advanced Method Concepts
Section: Chapter Questions
Problem 8RQ
icon
Related questions
Question

Java Program - Functions With Parameters and No Return Values

Create a function named palindrome that asks the user a string input if called. If the string is a palindrome, print “{input} is a palindrome!”, otherwise print “{input} is not a palindrome!”.

 

In the main function, call the palindrome function.

Input

1. One line containing a single string

Output

Enter a string: racecar
racecar is a palindrome!
Test Cases
Constraints
Constraint 1
This code must call the function inside the main
Test Cases
O Test Case 1
Your Output
No Output
Expected Output
Enter a string: racecar
racecar is a palindrome!
Show Differences
O Test Case 2 Hidden
O Test Case 3 Hidden
8
Transcribed Image Text:Test Cases Constraints Constraint 1 This code must call the function inside the main Test Cases O Test Case 1 Your Output No Output Expected Output Enter a string: racecar racecar is a palindrome! Show Differences O Test Case 2 Hidden O Test Case 3 Hidden 8
Expert Solution
steps

Step by step

Solved in 4 steps with 2 images

Blurred answer
Knowledge Booster
Datatypes
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Microsoft Visual C#
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,