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
What is a quick definition of the Protestant Reformation
Xelga [282]
A 16th century religious movement that attempted to reform the Roman Catholic Church
8 0
3 years ago
“Where I Lived, and What I Lived For” in Walden
SOVA2 [1]
D is the answer your looking for
5 0
3 years ago
Your boss has asked you to e-mail a client to let her know that the company will be late in delivering a report she's requested.
Papessa [141]
inthink the answer is a
3 0
3 years ago
Read 2 more answers
Which of the following statements is TRUE of attachment?
algol13

Answer: B

Explanation: the bond that a mother and infant form is a bond that could and should last a life time. The bond is how the child knows who its mother is from birth verses everyone else around the child.

6 0
3 years ago
In online learning, who is responsible for checking to make sure assignments are turned in?
zloy xaker [14]

Answer: b

Explanation:

3 0
3 years ago
Read 2 more answers
Other questions:
  • Caleb walks over and links his arm with judith. caleb is maintaining an____ distance.
    15·1 answer
  • Which pair of scientists shared the most similar views of behavior?
    10·1 answer
  • Need help with this ap chem free response!
    11·1 answer
  • Carefully read the following paragraph: "Learning takes place during all the child's activities and interactions. The classroom
    7·1 answer
  • mentally healthy people are those that is ____ or attempting to strive towards ideal functioning (fill in the blank) will mark b
    12·1 answer
  • I need to find Y, process?
    8·1 answer
  • research question plz answer honestly: How old are you (if you feel uncomfortable saying age u can replace with grade) and are y
    14·2 answers
  • In operant conditioning, the concept of contingency is exemplified by an "if A, then B" relationship in which A and B, respectiv
    15·1 answer
  • Hai! I am looking for a frined must be anti-trump supporting lgbtq+ and blm and liking BTS
    12·2 answers
  • Which of the following activities would not help you answer the third essay
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!