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]
3 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]3 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
Which greek island did odysseus come from
tester [92]

Answer:

island of Ithaca

Explanation:

dont know if you need an explanation, tell me if you do

5 0
3 years ago
Read 2 more answers
How important was Union naval supremacy to the North’s eventual victory?
Burka [1]
It was crucial to the north’s war strategy because it allowed the orth to follow through with the anaconda plan and other blockades of southern access the northern navy was especially advantageous in the union victory at the battle of new orleans
7 0
3 years ago
What does department of tourism have to do with hotel industry
ohaa [14]

do you happen to have boneless pizza

7 0
3 years ago
I’ll give you brainliest if you give me an introduction that hooks the reader and that is about :
Oksi-84 [34.3K]
Childhood trauma (typically domestic abuse) is a big factor in preteen/teen age abuse. Some parents may teach their kids that you shouldn’t cry, so they express those emotions in ways of anger. Violence always makes things worse, it never solves the issue it just makes things 10x worse. (Share a time where someone used violence against you or you used violence as an example) There are many ways to prevent violence. Teaching your kids and other people that it’s completely okay to cry, and it’s normal to have emotions where you’re angry but we can never use violence.

Hoped this helped!
3 0
3 years ago
Ashley is taking an essay test in science. Her teacher tells the class what the essay question is so they can create notes befor
marysya [2.9K]
Spend less time remembering and more time actually working. Also prepare the night before so she doesn't forget
8 0
3 years ago
Read 2 more answers
Other questions:
  • Match each word or phrase to its correct definition.
    14·2 answers
  • Describe some of the negative effects this skewed sex ratio has on countries.
    13·1 answer
  • Donna is thinking about buying a house that costs $100,000. If she puts down $20,000 and is able to get a 5 percent mortgage, sh
    14·2 answers
  • A right shift of the aggregate demand line causes an increase in
    12·1 answer
  • A child, 1 m tall, is walking directly under a street lamp that is 5 m above the ground. If the child walks away from the light
    5·1 answer
  • 4. In the figure below, the measure of angle A is 35°. If the
    7·1 answer
  • 50 points for all enjoy.<br>​
    13·2 answers
  • Where's the word of France came first​
    5·1 answer
  • which form of government, practiced in certain greek city-states, describes a system of shared rule by a group of elite, wealthy
    12·1 answer
  • 100 points if you answer correctly!
    9·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!