SMALL

자바 3

1, 2차원 배열로 위도, 경도 표현하기

Colored By Color Scripter™12345678910111213141516171819202122232425262728public class GeoPoint { public static void main(String[] args) { // 실수 변수 double latitude1 = 37.52127220511242; double longitude1 = 127.0074462890625; // 서울 double latitude2 = 35.137879119634185; double longitude2 = 129.04541015625; // 부산 System.out.println(latitude1 + "\t" + longitude1); // 실수 1차원 배열 double[] latIng1 = {la..

Study/JAVA 2019.02.24

멤버 메서드를 이용하여 신체 지수 구하기

Colored By Color Scripter™123456789101112131415161718192021public class BioCalendar3 { public static final int PHYSICAL = 23; //상수 (개발자 정의) int index = PHYSICAL; // 상수값을 변수에 대입 static int days = 1200; public static void main(String[] args) { BioCalendar3 bio = new BioCalendar3(); // 인스턴스 생성 double phyval = bio.getBioRhythm3(days, PHYSICAL, 100); System.out.printf("나의 신체 지수 %1$.2f입니다.\n", phyval)..

Study/JAVA 2019.02.24

Math 클래스를 사용하여 신체 지수 구하기

Colored By Color Scripter™12345678910111213public class BioCalendar2 { public static final int PHYSICAL = 23; //상수 (개발자 정의) public static void main(String[] args) { int index = PHYSICAL; // 상수값을 변수에 대입 int days = 1200; double phyval = 100*Math.sin((days % index) * 2 * Math.PI/index); System.out.printf("나의 신체 지수 %1$.2f입니다.\n", phyval); }} Math 클래스는 java.util 패키지에 있고, 이 클래스의 메서드는 대부분 static으로 객체 생..

Study/JAVA 2019.02.23