ExtArgs

ExtArgs - num = Double.parseDouble(args[i]); // converts a...

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

This note was uploaded on 11/30/2009 for the course COMP 110 taught by Professor Stotts during the Spring '08 term at UNC.

Ask a homework question - tutors are online