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
Arisa [49]
3 years ago
13

I need to create a method named "root positive". which will either print the square root of the number passed to it or if the nu

mber is less than zero, it will print out the statement "Number must not be negative."?
1. Ask the user to input a number of type double which you will find the square root of the number.

2. Create a method called rootPositive which will either print the square root of the number passed to it or if the number is less than zero, it will print out the statement "Number must not be negative.".

3. Call your rootPositive method and pass to it the number the user enetered.
Computers and Technology
1 answer:
rjkz [21]3 years ago
5 0

Answer:

Explanation:

The following code is written in Java. It is a method that calculates the square root of a number as requested. The method first checks with an IF statement if the parameter value is a positive number and then calculates the square root and prints it to the screen. Otherwise, it prints Number must not be negative. A test case has been provided in the main method and the output can be seen in the attached image below.

import java.util.Scanner;

class Brainly {

   public static void main(String[] args) {

       Scanner in = new Scanner(System.in);

       System.out.print("Enter a number of type double to calculate square root:");

       double num = in.nextDouble();

       rootPositive(num);

   }

   public static void rootPositive(double num) {

       if (num > 0) {

           System.out.println(Math.sqrt(num));

       } else {

           System.out.println("Number must not be negative.");

       }

   }

}

You might be interested in
If you wanted to look up an article from the Chicago Tribune the best place to start would be
anyanavicka [17]
Books,well trusted websites , news.reports , schools library (online and off ) hope this helps.:-)
7 0
3 years ago
Which item is not part of a college application
olga_2 [115]

Answer:

Explanation:

application form and any fees

4 0
3 years ago
Which automated method for VPN connection deployment would work best in combination with Microsoft Intune or Microsoft Endpoint
maks197457 [2]

There are different kinds of automated method for VPN connection deployment. The automated method for VPN connection deployment would work best  is ProfileXML

  • ProfileXML is known to be often used as a delivery methods in Windows PowerShell, Microsoft Endpoint Configuration Manager, and Intune. For an individual to be able to use the ProfileXML VPNv2 CSP setting, one have to construct XML by using the ProfileXML schema.

An individual can configure the Always On VPN client by using the PowerShell, Microsoft Endpoint Configuration Manager, or Intune. They all need an XML VPN profile to configure the appropriate VPN settings.

Learn more from

brainly.com/question/25554117

3 0
2 years ago
Jenny is working on a laptop computer and notices that the computer is not running very fast. She looks and realizes that the la
Stolb23 [73]

Answer:

You are allowed to take out the old ram to replaice it, so replaice it with 2 new 4 GB of ram you dont need to unless the laptop has already 4 GB of ram the type of ram you will use is DDR3 most newer pc's have DDR4 since laptopes are smaller you would need older ram

Explanation:

8 0
3 years ago
Read 2 more answers
T is important to remember to print the return address when printing an
expeople1 [14]
Shipping label? Ggggggggggggg
6 0
3 years ago
Other questions:
  • _________ is the process of scanning the network to find out which Internet Protocol (IP) addresses are attached to potentially
    9·1 answer
  • For your new sporting goods store, you originally planned to only sell Nike shoes. Therefore, you only had enough shoe displays
    11·2 answers
  • How is the EF​ computed? A. ES​ + Activity time B. LF minusActivity time C. ​Min{LS of all immediate following​ activities} D. ​
    11·1 answer
  • . Business-to-business integration (B2Bi) is vital for efficient and accurate flow of data across internal ISs and external busi
    11·1 answer
  • You can combine the algorithms for converting between infix to postfix and for evaluating postfix to evaluate an infix expressio
    13·1 answer
  • Arrange the steps below to outline what maia needs to do to accomplish this task.​
    9·1 answer
  • Your bluetooth headset is waiting for another bluetooth device to locate its signal. what is this mode known as?'
    8·1 answer
  • You are trying to log in to your old computer, and can't remember the password. You sit for hours making random guesses... I'm s
    10·1 answer
  • A type of VPN connection, where a single computer logs into a remote network and becomes, for all intents and purposes, a member
    13·1 answer
  • Plz help fast! will mark brainliest!<br><br>List three ways that music is used in modern society.
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!