Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

What is the output As we are having CalculateApp public class in following code, we have to name the file Calculate App.java wherever we store

What is the output
image text in transcribed
As we are having CalculateApp public class in following code, we have to name the file Calculate App.java wherever we store it. For any query please comment on answer , i will try best to solve your issue import java.util.Scanner; // this will import Scanner class which is used for take inputs from user class Calculate //only one public class have to be there in one java file { double nl,n2; 1/here we are taking two input numbers from user inside class constructor public Calculate() { double num1, num2; Scanner reader = new Scanner(System.in); System.out.print("Enter two numbers: "); numl - reader.nextDouble(); num2 = reader.nextDouble(); assignValues (numi, num2); } //following method is called for assign values to ni&n2 which are entered by user public void assignValues (double numl, double num2) { this.nl = num; this.n2 num2; //following will print output of doMath by calling it. System.out.println(domath(nl,n2)); > public double doMath(double x, double y) return (-y); } > public class calculateApp { public static void main(String[] args) { Calculate cal - new Calculate(); )

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

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

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

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

Get Started

Recommended Textbook for

Visual C# And Databases

Authors: Philip Conrod, Lou Tylee

16th Edition

1951077083, 978-1951077082

More Books

Students also viewed these Databases questions

Question

Why is entrepreneurship important? LO.1

Answered: 1 week ago