Yes, it's a better choice and you'll feel safe
Answer:
import java.util.Scanner;
public class Solution {
public static void main(String args[]) {
Scanner scan = new Scanner(System.in);
int userNum = scan.nextInt();
if (userNum > 0) {
System.out.println("Positive.");
} else {
System.out.println("Non-positive, converting to 1.");
userNum = 1;
System.out.println("Final: " + userNum);
}
}
}
Explanation:
There was no error found when the code was run. The code segment was just added to a main method and it runs successfully.
Based on the full code above;
The first line import the Scanner class which allow the program to receive user input. Then the class was defined as Solution. Then the main method was defined. Inside the main method, we created a scanner object scan which receive the input via keyboard. The user input is assigned to the variable userNum. Then the if-conditional statement is executed; if userNum is greater than 0, "Positive" is output. Else userNum is converted to 1 and outputted to the screen.
Answer:
This seems to be a Geography question, However, I am answering. The Metamorphic rock textures lies in two larger groups. They are the Non-Foliated and the Foliated.
Explanation:
The answer above explains everything. However, we need to understand the Foliation, and exactly what it is. It is actually developed in the rock through parallel alignment of various minerals(platy), like muscovile, chlorite and biotite, as well as minerals which are needle type such as homblende or feldspars, which are the various tabular minerals.
They produce a 1:1 ratio. The input power is equal to the output power.