Write a program that uses same function names the same function name of class to we two input values from user and display values
Answers
Answered by
0
Answer:
import java.util.Scanner;
public class Display
{
public static void main(String args[])
{
Display A = new Display(); /*Creating object 'A'*/
A.Displayvalues(); /*Calling Function*/
System.out.println("Thanks for using the program...!");
}
public void Displayvalues() /*User defined function to display values*/
{
Scanner Titan = new Scanner(System.in);
System.out.println("Enter the first number...");
double a = Titan.nextDouble();
System.out.println("Enter the second number...");
double y = Titan.nextDouble();
System.out.println("The first number you entered is..."+a" The second number you entered is..."+y);
}
}
/* Hope it helped you...*/
/* Hope it helped you...*//* Kindly Mark as Brainliest...*/
Similar questions