Which of the following code displays the area of a circle if the radius is positive.

a. if (radius != 0) System.out.println(radius * radius * 3.14159);
b. if (radius >= 0) System.out.println(radius * radius * 3.14159);
c. if (radius > 0) System.out.println(radius * radius * 3.14159);
d. if (radius <= 0) System.out.println(radius * radius * 3.14159);

c Positive means > 0.

Computer Science & Information Technology

You might also like to view...

Which of the following is NOT a criteria for open source software?

A) There can be no discrimination against persons or groups. B) There is a fee for redistribution. C) There can be no discrimination against fields of endeavor. D) The license must not be specific to the product.

Computer Science & Information Technology

Match the following terms to their meanings:

I. HTML II. Webpage III. Tag IV. XML V. XML schema A. Text files that contain text and codes that a web browser interprets as the page is loaded B. If you need to display an Access object on a webpage, export the object to this format C. Language recognized by many programs that allows you to create your own set of tags D. Begins with the character < and ends with the character > E. It defines the tag names, order, relationships, and data type and is essential to ensure that all of the table relationships and data types are preserved when the data is imported into another database

Computer Science & Information Technology