Respuesta :
Answer:
Your program will cause lossy conversion from double to int.
Explanation:
I have analyzed you code properly. You need to take the input as a double number and convert it to an integer. You are making two mistakes in your code.
1) You have not declared the main class. Therefore, the program is unable to find a main class and throwing an error of not loading the main class. Therefore, you have to replace "class Lesson_6_Activity_Two" with "public class main".
2) You are assigning a double value to an integer. It cause a lossy conversion from double to int. Therefore, majority of compilers will throw this. To convert double to int, you have to typecast the double using "intValue();" function.
For more understanding, I have attached the correct code below.
import java.util.Scanner;
public class Main
{
public static void main(String[] args) {
System.out.println("Please input a decimal number");
Scanner scan = new Scanner (System.in);
Double x = scan.nextDouble();
System.out.println("Output");
int b = x.intValue();
System.out.println(b);
}
}
Answer:
num = float(input("45.6")
if num>45.6
print("90")
else:
print("Not greater than 45.6")
Explanation:
im not sure