Instructions: Answer the following questions one at a time. After answering each question, check your answer (by clicking on the check-mark icon if it is available) before proceeding to the next question.
Getting Ready: Before going any further, you should:
WhatAnEgo.java? In other words, what formal
parameter of the main() method will hold the command
line arguments?
0 of the array
named args?
Text class has a method with the following
signature:
public static double toNonnegativeDouble(String s)
that converts a String representation of a non-negative
double contained in the parameter named s
to a non-negative double value and returns it.
In the event that s does not represent a non-negative
double it will return the value -1.0
instead.
String
literal "5.9"?
String[] named args?
percentage, rank,
and size so that they are now double
values. What do those statements look like now?
size
so that, instead of being assigned 1100, it is
assigned the double value of the 0th element of the
command line arguments. What is the modified assignment statement?
1, it is assigned the double
value of the 1st element of the command line arguments. What is the modified
assignment statement?
1100.0 1.0 in the "Run Arguments" text field.
Copyright 2020