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
topjm [15]
4 years ago
7

Write the code to input a number and print the square root. Use the absolute value function to make sure that if the user enters

a negative number, the program does not crash.
Advanced Placement (AP)
1 answer:
lukranit [14]4 years ago
6 0

Answer:

Explanation:

Language?

I'm assuming this is AP CS A so I'll do it in java.

import java.util.Scanner;

class Main {

public static void main(String[] args) {

   Scanner input = new Scanner(System.in);

   System.out.print("Number: ");

   int sqrtNumber = Math.abs(input.nextInt());

   double printableNumber = Math.sqrt(sqrtNumber);

   System.out.println(printableNumber);

 }

}

You might be interested in
The first three fields of study in psychology were what?
garik1379 [7]

Answer:

Behavioral psychology by Skinner, Watson

Psychoanalysis by Freud

Humanistic psychology by Maslow, Rogers

Explanation:

8 0
3 years ago
8. What number does the density have to be less than for it to float in water? Write a
Masteriza [31]

Answer:

Answer: Compare the density of the object in question to the density of water. If its density is less than water, it will float. For example, oak floats because its density is 0.7 g/cm³. If the density of an object is greater than water, it will sink.

Explanation:

6 0
3 years ago
The amount of mismanaged plastic globally is 31.9 million tonnesper year. If the US contributes .022 million tonnesper month, wh
Yanka [14]

Answer:

During the midst of the 2016 campaign, however, we faced “an abnormal situation: one of America’s two major parties has nominated an explicitly authoritarian candidate for the presidency,” which posed “a present danger to American democracy

Explanation:

During the midst of the 2016 campaign, however, we faced “an abnormal situation: one of America’s two major parties has nominated an explicitly authoritarian candidate for the presidency,” which posed “a present danger to American democracy

6 0
3 years ago
Which institutes offer four-year bachelor’s programs?
Art [367]
Almost all universities
4 0
3 years ago
Read 2 more answers
What were the effects of the Columbian Exchange on the Eastern Hemisphere? (Eastern Hemisphere specifically)
abruzzese [7]

Answer:

The New World introduced the Eastern Hemisphere to vanilla, tobacco, beans, cacao (which can be harvested to make chocolate), pumpkins, corn, tomatoes, potatoes, pepper, avocados, and peanuts.

8 0
3 years ago
Other questions:
  • What are 10 important events that take place in the novel The Girl Who Owned a City
    5·1 answer
  • Assume that the banner needs to be 18 feet long instead of 15 feet
    13·2 answers
  • Select all that apply.
    8·1 answer
  • HEY I NEED HELP W AN AP CALC AB QUESTION ASAP
    7·2 answers
  • Which of the following is an example of mitigation of global climate change?
    8·2 answers
  • What does it mean to be human? Logically, does it mean to think like a nihilist? Like we’re merely just dust and atoms of someth
    12·2 answers
  • Why are advertisements for candidates not as effective as advertisements for products???
    12·1 answer
  • Penny has a group of friends who are really smart with computers. They claim they have a fool proof way to access questions to t
    9·1 answer
  • Question
    8·1 answer
  • What changes to human life were caused by settled agricultural development
    15·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!