Answer:
Explanation:
The following code is written in Java. It is a method that calculates the square root of a number as requested. The method first checks with an IF statement if the parameter value is a positive number and then calculates the square root and prints it to the screen. Otherwise, it prints Number must not be negative. A test case has been provided in the main method and the output can be seen in the attached image below.
import java.util.Scanner;
class Brainly {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
System.out.print("Enter a number of type double to calculate square root:");
double num = in.nextDouble();
rootPositive(num);
}
public static void rootPositive(double num) {
if (num > 0) {
System.out.println(Math.sqrt(num));
} else {
System.out.println("Number must not be negative.");
}
}
}
Answer:
The formula and value to this question is "=A1+A3+A4+A5 with value 100"
Explanation:
The explanation of the given question as follows:
- In question, it is defined that four cells that are "A1, A2, A3, and A4" contains value that are "10, 20, 30, and 40".
- To add these values we use addition formula that is "=A1+A2+A3+A4". it will give value 100.
- If the user inserts a new row that is "A2" and assigns a value in the cell that is "50" so, we use the above formula that adds values with these values we also use the value "100".
Answer:
The answer is B = 365
Explanation:
The following variable were initialized:
a = 1
b = 10
c = 100
x = 0
Then we store the value of 'c' times 3 in 'x'
x = 3 * c = 3 * 100 = 300
x = 300
Then we add the value of 'b' times 6 to the value already in 'x'
x = x + 'b' times 6
x = x + (b * 6) = 300 + (10 * 6) = 300 + 60 = 360
x = 360
Then we add the value of 'a' times 5 to the value already in 'x'
x = x + 'a' times 5
x = x + (a * 5) = 360 + (1 * 5) = 360 + 5 = 365
x = 365.
Therefore, the value of 'x' displayed is 365.