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
What college course would I need to take to be a part of recreation in a long-term care facility?
diamong [38]

You would need to take a Recreational Therapist Careers course to be part of recreation in a long-term care facility.

6 0
3 years ago
Read 2 more answers
In the second and third sentences of the fifth paragraph (“He stops . . . gradual explanation”), the author presents a humorous
Elis [28]

Answer:

D. desire to surprise his friend and his friend’s failure to recognize him

Explanation:

Answer D

Correct. In these sentences, the author presents a humorous reversal that emerges from the ironic incongruity between the traveler’s plan to “overpower” his old friend with an excess of pleasure and the anticlimactic outcome of the surprise visit. As it turns out, the friend experiences no immediate pleasure from the visit because he fails to recognize the traveler and can only be made to remember him after the traveler gives a “gradual (in this context, methodical) explanation” of who he is.

7 0
3 years ago
Read 2 more answers
Movement affects the global economy in all the following ways EXCEPT
Yuliya22 [10]
What are the choices?
8 0
3 years ago
Bro I need help
Morgarella [4.7K]

Answer: second place

5 0
3 years ago
Read 2 more answers
Ryan is a young teen who has constant access to the Internet. In what way is he likely to misuse this access?
erik [133]

Answer:

B. by chatting with friends

C. by downloading violent or sexual content

Explanation: The immoderate use of internet can decrease Ryan's concentration for studying and lead him to explore deeper into the internet world. By having access to almost everything online, he can delve into online sexual content and develop interest in it. Since the content varies, it is most likely for Ryan to get attracted to violent content. Also, as a teenager, instead of using internet to gather information for a lecture or a test, he can quickly lose interest by being online with his friends constantly. Therefore, it is very important for parents to have some kind of control of the teenager's online surfing since it can deeply affect his concentration, mental health and view of sexual intercourse.

4 0
3 years ago
Other questions:
  • Surface area of a cylinder is??
    15·1 answer
  • It is important to remember everything you read, the first time you read it.
    10·2 answers
  • 4. In which way was freedom a central idea in the Declaration of Independence?
    8·1 answer
  • In one investigation, researchers followed three adolescent cohorts, each born a year apart, over three years to see if family h
    7·1 answer
  • Economic development results in low agricultural density because
    6·2 answers
  • “1. For having upon specious pretenses of public works raised great unjust taxes upon the Commonality for the advancement of pri
    12·1 answer
  • What organism is the main producer in freshwater ecosystems? A) phytoplankton B) zooplankton C) anaerobic bacteria D) freshwater
    13·1 answer
  • John owns three different auto repair shops. In 2016, Store A made a profit of $102,100, Store B made a profit of $200,500, and
    9·1 answer
  • SpongeBob and nuggets
    13·2 answers
  • Các kỹ năngcủa một người lãnh đạo cần có và giải thích từng vai trò của từng kĩ năng
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!