Answered step by step
Verified Expert Solution
Question
1 Approved Answer
make a new file named Proj 1 2 Runner.java to meet the specifications given below. Note that you must not modify the code in the
make a new file named ProjRunner.java to meet the specifications given below.
Note that you must not modify the code in the file named Projjava.
Be sure to display your name in the output as shown below.
When you place both files in the same folder, compile them both, and run the file named Projjava, the program must display the text shown below on the command line screen.
The input String values depend on the values of three commandline arguments that are entered when the program is run. If no commandline arguments are entered, the program defaults to input values of Madam, radar, and defied. The output for commandline argument values of racecar, Rotor, and level is shown below. Your program will be tested with different commandline arguments.
For this assignment, your code must examine three incoming String values and determine if each string is or is not a palindrome. For this assignment, a palindrome is defined as a string that has the same characters, forward and backward. Your program must return a threeelement boolean array indicating if each string is a palindrome. Return true if the string is a palindrome, false if it is not a palindrome. Note in the example shown below that the string Rotor is not a palindrome due to the case, upper and lower, of the characters at each end of the string. Make sure that you return the boolean values in the correct order as shown below.
Your solution for this assignment must use one or more lambda expressions. Among other things, this means that your code must use one or more statements that contain the arrow operator.
The following should display when run:
"Use commandline arguments.
Input values to student code racecar,Rotor,level
Student's solution must use lambda expressions.
Call student's run method.
I certify that this program is my own work
and is not the work of others. I agree not
to share my solution with others.
Print your name here.
Display results returned from student's code.
racecar: true
Rotor: false
level: true
That's all folks."
Projjava cannot be modify
File Projjava
The purpose of this assignment is to assess the student's
ability to write programs that use lambda expressions and
the Predicate functional interface from the
java.util.function package.
Student must not modify the code in this file.
class Proj
public static void mainString args
String x "Madam";
String y "radar";
String z "defied";
ifargslength
System.out.printlnUse default input values.";
elseget x y and z from args
System.out.printlnUse commandline arguments.";
x args;
y args;
z args;
;end else
System.out.println
Input values to student code
x y z;
System.out.println
Student's solution must use lambda expressions.";
Instantiate an object from the student's code.
ProjRunner obj new ProjRunner;
System.out.println
Call student's run method.";
boolean result obj.runxyz;
System.out.println
Display results returned from student's code.";
System.out.printlnx : result;
System.out.printlny : result;
System.out.printlnz : result;
System.out.println
That's all folks.";
end main
end class Proj
End program specifications.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started