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
ella [17]
3 years ago
11

NOTE: in mathematics, the square root of a negative number is not real; in Java therefore, passing such a value to the square ro

ot function returns a value known as NaN (not-a-number). Given a double variable named areaOfSquare write the necessary code to read in a value, the area of some square, into areaOfSquare and print out the length of the side of that square. HOWEVER: if any value read in is not valid input, just print the message "INVALID". ASSUME the availability of a variable, stdin, that references a Scanner object associated with standard input.
import java.util.Scanner;

class square_root
{
public static void main (String[] args)
{
Scanner s=new Scanner(System.in);
System.out.print("Enter the area: ");

double areaOfSquare=s.nextDouble();
if(areaOfSquare<0)
{
System.out.println("INVALID");
System.exit(2);
}
System.out.println("The side of the square is: "
+Math.sqrt(areaOfSquare));
}
}
Computers and Technology
1 answer:
zavuch27 [327]3 years ago
4 0

Answer:

import java.util.Scanner;

class square_root

{

public static void main (String[] args)

{

Scanner s=new Scanner(System.in);

System.out.print("Enter the area: ");

double areaOfSquare=s.nextDouble();

if(areaOfSquare<0)

{

System.out.println("INVALID");

System.exit(2);

}

System.out.println("The side of the square is: "

+Math.sqrt(areaOfSquare));

}

}

Explanation:

You might be interested in
What is the full form of computer​
Annette [7]

Answer:

Common Operating Machine Purposely Used for Technological and Educational Research

Explanation:

4 0
3 years ago
Read 2 more answers
Green computing can be achieved by: a. using video conferencing, electronic meeting systems, and groupware. b. replacing meeting
Rama09 [41]

Answer: using video conferencing, electronic meeting systems, and groupware

Explanation:

Green computing simply means the use of computer in a way that's environmental friendly.

One way to achieve this is through using video conferencing, electronic meeting systems, and groupware. This allows the use of computers not to have a negative effect on the environment.

4 0
3 years ago
After running this Assembly language program below, give the final values in EAX, EBX, and ECX. MOV EAX, AAAAAAAA MOV EBX, BBBBB
Verdich [7]

Answer:

See explaination please.

Explanation:

We are going to get a solution by making use of the instruction;

Given The instruction,

MOV EAX, AAAAAAAA

MOV EBX, BBBBBBBB

MOV ECX, CCCCCCCC

This is going to move the defined values, say AAAAAAAA, BBBBBBBB, CCCCCCCC, to the registers EAX, EBX, ECX, respectively

Now,

PUSH AX

This push instruction pushes the first 8 bits in register EAX, to a stack,

again, PUSH BX

Also this push instructions will also push the first 8 bits in register EBX, to the stack

PUSH CX

This push instruction pushes the first 8 bits in register ECX, to the stack,

similarly PUSH BX PUSH AX PUSH CX pushes the 8 bit registers in the same stck,

NOw, the instructions POP EAX POP EBX POP ECX

will lead to the contents of the respective registers as

EAX=CCCCAAAA EBX=CCCCBBBB ECX=AAAACCCC

4 0
4 years ago
Read 2 more answers
How many steps make up the research process?
IRISSAK [1]
There are ten steps in a research project
6 0
4 years ago
Read 2 more answers
Scott is inspired by one of his friends to write a research paper. how should he go about writing the research paper?
VLD [36.1K]

Scott first step is to ask people who are more educationally inclined in that filed about the work or use the internet or library to research on the topic or previous work that is done in that area.

<h3>What is a research paper?</h3>

This is known to be a kind of written essay on a topic that is done in depth.

Therefore, Scott first step is to ask people who are more educationally inclined in that filed about the work or use the internet or library to research on the topic or previous work that is done in that area.

Learn more about  research paper from

brainly.com/question/25257437

#SPJ1

4 0
2 years ago
Other questions:
  • What can help establish the focus and organization it relies on?
    6·1 answer
  • Consider the following method:
    8·2 answers
  • What was the Messana conflict
    7·1 answer
  • (01.05 LC)
    7·2 answers
  • How many bits long is a autonomous system number?
    13·1 answer
  • A deluxe meal, represented by a DeluxeMeal object, includes a side dish and a drink for an additional cost of $3. The DeluxeMeal
    14·1 answer
  • One benefit of open source software is that it
    9·1 answer
  • What is the command for basic router configuration?
    6·1 answer
  • What is another word for: a location in memory that contains a value?
    7·2 answers
  • It displays the contents of the active cell. It allows you to enter and edit data, such as formulas.
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!