{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

ExtArgs - num = Double.parseDouble(args[i converts a text...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
class ExtArgs { c // this program will take command line arguments that look // like numbers and print the square of each one public static void main (String[] args) { double num; double sqr; int i; for (i=0; i<args.length; i++) {
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: num = Double.parseDouble(args[i]); // converts a text string to a double // if it can. .. if the text string // looks like a number sqr = num * num; System.out.println(sqr); } } }...
View Full Document

{[ snackBarMessage ]}

Ask a homework question - tutors are online