Answer to Question #240693 in Java | JSP | JSF for Nguu

Question #240693

Given Create a program that when run with a name, an integer and a double as CMD arguments, it prints out a greeting using the name and also print the difference of the two given numbers


1
Expert's answer
2021-09-22T23:48:36-0400
import java.util.Scanner;
public class Main
{
	public static void main(String[] args) {
	    int N;
	    String name;
	    int x;
	    Scanner input=new Scanner (System.in);
	    System.out.println("Enter an interger: ");
	    N=input.nextInt();
		System.out.println("Enter the name: ");
		name=input.next();
		System.out.println("Enter a double number: ");
		x=input.nextInt();
		double D=N-x;
		System.out.println("Hello "+name+" "+"the difference is: "+D);
	}
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS