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
Refer to the above diagram for physician office visits. If health-care insurance reduces the insured party's co-pay price per ph
PilotLPTM [1.2K]

Answer:

他當選,出租車上的詹姆斯敦是一個關於酒吧和平的問題,條形圖中的詹姆斯敦不知道他們在哪裡

8 0
3 years ago
Who thinks zoology is hard?? I'm interested in taking the class but I've been told it's really hard??
Gala2k [10]
I took it, I find it interesting but pretty difficult, It all depends on who you are asking though. :)
4 0
3 years ago
explain one development in the period before 1930 that would support duara's claim that japan had "amply demonstrated its leader
NNADVOKAT [17]

Answer:

One piece of evidence that Duara uses in the passage to support his claim regarding Western racial attitudes and Japanese militarism in the second paragraph is where he says that Japan was allotted a lower quota of ships than the British and Americans.

7 0
3 years ago
Read 2 more answers
How would you know your living a dream when you already pinched yourself????????????
vekshin1

Answer:

ok

Explanation:

3 0
3 years ago
Read 2 more answers
Using the word HOMES to remember the Great Lakes is an example of
love history [14]

Answer: An Acronym

Explanation:

4 0
3 years ago
Other questions:
  • President Hoover's refusal to provide funds for the unemployed during the Depression was based on his belief that
    15·1 answer
  • What is MLS?
    11·1 answer
  • Giving feedback through out gymnastics unit is what type of evaluation​
    12·1 answer
  • Why is it important for the bureau of land management to have current land use plans in place?
    7·2 answers
  • Ocean currents near the equator are primarily:
    12·2 answers
  • Q U I E RO UN N O VI O
    12·1 answer
  • If mother have two biscuits only but she have to give it to her5 children who are very hungry so to whom need she give that bisc
    14·2 answers
  • Doctors that take care of drawing blood
    9·1 answer
  • Việt nam đứng thứ mấy của thế giới
    12·1 answer
  • Which of the following was NOT a reason for rapid suburbanization in the United States after the Second World War?
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!