1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Snezhnost [94]
3 years ago
11

Which of the following code displays the area of a circle if the radius is positive. a. if (radius != 0) System.out.println(radi

us * 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);
Computers and Technology
1 answer:
maw [93]3 years ago
8 0

Answer:

d. if (radius > 0) System.out.println(radius * radius * 3.14159);

Explanation:

The positive values are those values that are greater than 0(zero).0 is considered to be nonnegative number it is neither positive nor negative and for a zero radius the area will be 0.As we know the are of the circle is π*radius*radius, and π is 3.14159.So the correct answer matching to this condition is option d.

Which checks if the radius is greater than 0 then find the radius and print it.

You might be interested in
How many cost units are spent in the entire process of performing 40 consecutive append operations on an empty array which start
Alexus [3.1K]

Answer:

Explanation:

260 cost units, Big O(n) complexity for a push

6 0
2 years ago
The class constructor function must have the same_______ as the class,
inn [45]

Answer:

Name.

Explanation:

The constructor in the class must have the same name as the class.Constructors are used to initialize the object when created.There are basically three types of constructors which are as following:-

  1. Default Constructor.
  2. Parameterized Constructor.
  3. Copy Constructor.

Default Constructor:-This constructor is already present in the class when the class is defined.It does not have any arguments.

Parameterized Constructor:-As the name suggests this constructor have parameters that are used to initialize the object.

Copy Constructor:-This constructor is called whenever an object is copying the values of other object.For example:-

There is already an object present with name obj1.

class obj2=obj1;

5 0
3 years ago
rite a function to prompt the user to enter the information for one movie (title, release date, mpaa rating and number of stars)
vesna_86 [32]

Answer:

import java.util.*;

public class Movie {

   

   public static void main (String [] args) {

       

       System.out.println(movieInfo());

       

   }

   public static String movieInfo() {

       Scanner input = new Scanner(System.in);

       Scanner input2 = new Scanner(System.in);

       

       System.out.print("Enter the title: ");

       String title = input.nextLine();

       System.out.print("Enter the release date: ");

       String releaseDate = input.nextLine();

       System.out.print("Enter the mpaa rating: ");

       double mpaaRating = input2.nextDouble();

       System.out.print("Enter the number of stars: ");

       double numberOfStars = input2.nextDouble();

       

       return "Title: "+title+ "\nRelease Date: "+releaseDate+ "\nMPAA Rating: "+ mpaaRating+ "\nNumber of Stars: "+numberOfStars;

   }

}

Explanation

- Create a function called <em>movieInfo()</em> that returns a string, information about a movie

- Ask the user to enter the title, release date, mpaa rating and number of stars of the movie.

- Return these values at the end of the function

- Inside the main, call the function to see the information about the movie

7 0
3 years ago
How to bypas power switch on pc and make it switch on
Andreas93 [3]
If your powersupply has the standard 24 pin connector, you can make it switch on by connecting a green and a black (find a good picture to see the pin numbers). Google for the "paperclip test" for details.
6 0
3 years ago
I will give brainliest !!
OverLord2011 [107]
Do these questions have given answers already?
3 0
2 years ago
Other questions:
  • Deterime the minimum number of multiplication operations needed to compute the following. Show the order of the computations.
    10·1 answer
  • Why is it important to send a cover letter with a resume?
    12·2 answers
  • Word 2013 in order to share a document online you must first
    10·1 answer
  • Write a method drivingCost() with input parameters drivenMiles, milesPerGallon, and dollarsPerGallon, that returns the dollar co
    10·1 answer
  • ____ is the security guarantee that people who intercept messages cannot read them. A. Availability B. Encryption C. Confidentia
    9·1 answer
  • 6.4 Predicting Prices of Used Cars. The file ToyotaCorolla.csv contains data on used cars (Toyota Corolla) on sale during late s
    5·1 answer
  • Rafael needs to add a title row to a table that he has inserted in Word. What should he do? Use the alignment options. Use the M
    14·2 answers
  • What will you better be prepared for by learning about the animals you photograph
    11·1 answer
  • Which is said to be ‘computer on a chip’ (a) Micro processors (b) Microcontrollers (c) Both (c) None of the above
    9·1 answer
  • Write a program that outputs inflation rates for two successive years and whether the inflation is increasing or decreasing. Ask
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!