Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

make a file named Proj 1 1 Runner.java to meet the specifications given below. Note that you must not modify the code in the file

make a file named Proj11Runner.java to meet the specifications given below.
Note that you must not modify the code in the file named Proj11.java.
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 Proj11.java, the program must display the text shown below on the command line screen.
The numeric output values depend on the values of two command-line arguments that are entered when the program is run. If no command-line arguments are entered, the program defaults to input values of 10 and 3. The output for command-line argument values of 16 and 5 is shown below. Your program will be tested with different command-line arguments.
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 displaym when the program is run:
"Input values to student code =16,5
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.
Sum: 21.0
Difference: 11.0
Product: 80.0
Quotient: 3.2
That's all folks."
Proj11.java (Should not be modify)
/*File Proj11.java
The purpose of this assignment is to assess the student's
ability to write programs that use lambda expressions
***********************************************************/
// Student must not modify the code in this file. //
class Proj11{
public static void main(String[] args){
int x =10;
int y =3;
if(args.length !=2){
System.out.println("Use default input values, 10 and 3");
}else{//get x and y from args
x = Integer.parseInt(args[0]);
y = Integer.parseInt(args[1]);
};//end else
System.out.println(
"
Input values to student code ="+ x +","+ y);
System.out.println(
"
Student's solution must use lambda expressions.");
//Instantiate an object from the student's code.
Proj11Runner obj = new Proj11Runner();
System.out.println("
Call student's run method.
");
double[] result = obj.run(x,y);
System.out.println(
"
Display results returned from student's code.");
System.out.println("Sum: "+ result[0]);
System.out.println("Difference: "+ result[1]);
System.out.println("Product: "+ result[2]);
System.out.println("Quotient: "+ result[3]);
System.out.println("That's all folks.");
}//end main
}//end class Proj11
//End program specifications.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions