W
W
Web__Nikita032019-09-21 13:09:56
Java
Web__Nikita03, 2019-09-21 13:09:56

Where I did not make a mistake when compiling the log. expressions?

It is necessary to check whether the point is included in the given area. Here is the picture
5d85f6b6d1de6426375131.png
Here is my code

import java.util.Locale;
import java.util.Scanner;


public class lesson1_5 {

    public static void main (String[] args) {
        Scanner MyScanner = new Scanner(System.in);
        MyScanner.useLocale(Locale.US);

        double x = MyScanner.nextDouble(), y = MyScanner.nextDouble();
        System.out.println((x >= 0 && y >= 0 && y <= 0.5 && (y <= Math.sin(Math.toRadians(x)))?"Yes":"No"));

        MyScanner.close();
    }
}

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Developer, 2019-09-21
@Web__Nikita03

x >= 0 && x < Math.PI && y >= 0 ...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question