From f77246fa87ff7cf4c60ee7987e14d9ea5d3fc84a Mon Sep 17 00:00:00 2001 From: Son-Chaeyi Date: Wed, 18 Jan 2023 18:13:38 +0900 Subject: [PATCH 1/5] =?UTF-8?q?=EC=86=90=EC=B1=84=EC=9D=B4=20=EA=B3=BC?= =?UTF-8?q?=EC=A0=9C=20=EC=A0=9C=EC=B6=9C=ED=95=A9=EB=8B=88=EB=8B=A4.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/sonchaeyi/report1/Report1_1 | 7 ++++ src/sonchaeyi/report1/Report1_2 | 23 +++++++++++++ src/sonchaeyi/report1/Report1_3 | 20 +++++++++++ src/sonchaeyi/report2/Report2_1 | 9 +++++ src/sonchaeyi/report2/Report2_2 | 60 +++++++++++++++++++++++++++++++++ src/sonchaeyi/report2/Report2_3 | 9 +++++ src/sonchaeyi/report2/Report2_4 | 13 +++++++ src/sonchaeyi/report2/Report2_5 | 10 ++++++ src/sonchaeyi/report2/Report2_6 | 13 +++++++ 9 files changed, 164 insertions(+) create mode 100644 src/sonchaeyi/report1/Report1_1 create mode 100644 src/sonchaeyi/report1/Report1_2 create mode 100644 src/sonchaeyi/report1/Report1_3 create mode 100644 src/sonchaeyi/report2/Report2_1 create mode 100644 src/sonchaeyi/report2/Report2_2 create mode 100644 src/sonchaeyi/report2/Report2_3 create mode 100644 src/sonchaeyi/report2/Report2_4 create mode 100644 src/sonchaeyi/report2/Report2_5 create mode 100644 src/sonchaeyi/report2/Report2_6 diff --git a/src/sonchaeyi/report1/Report1_1 b/src/sonchaeyi/report1/Report1_1 new file mode 100644 index 0000000..4b18763 --- /dev/null +++ b/src/sonchaeyi/report1/Report1_1 @@ -0,0 +1,7 @@ +//2-4. 다음 중 변수를 잘못 초기화 한 것은? + +정답 : +byte b = 256; +char c = ''; +char answer = 'no'; +float f = 3.14 \ No newline at end of file diff --git a/src/sonchaeyi/report1/Report1_2 b/src/sonchaeyi/report1/Report1_2 new file mode 100644 index 0000000..0def144 --- /dev/null +++ b/src/sonchaeyi/report1/Report1_2 @@ -0,0 +1,23 @@ +//2-7. 다음 문장들의 출력 결과를 적으세요. 오류가 있는 문장의 경우, '오류' 라고 적으세요. + +정답 : +System.out.println("1" + "2"); +- 12 + +System.out.println(true+""); +- true + +System.out.println('A' + 'B'); +- 131 + +System.out.println('1' + 2); +- 51 + +System.out.println('1' + '2'); +- 99 + +System.out.println('J' +"ava"); +- Java + +System.out.println(true + null); +- 오류 \ No newline at end of file diff --git a/src/sonchaeyi/report1/Report1_3 b/src/sonchaeyi/report1/Report1_3 new file mode 100644 index 0000000..9878592 --- /dev/null +++ b/src/sonchaeyi/report1/Report1_3 @@ -0,0 +1,20 @@ +//2-8. 아래는 변수 x, y, z의 값을 서로 바꾸는 예제이다. 결과와 같이 출력되도록 코드를 넣으세요. +public class Exercise2_8{ + public static void main(String[] args){ + int x = 1; + int y = 2; + int z = 3; + + 정답 : + int temp; + temp = x; + x = y; + y = z; + z = temp; + + System.out.println("x="+x); + System.out.println("y="+y); + System.out.println("z="+z); + } +} +//예상 결과 : x=2, y=3, z=1 \ No newline at end of file diff --git a/src/sonchaeyi/report2/Report2_1 b/src/sonchaeyi/report2/Report2_1 new file mode 100644 index 0000000..50ee5c2 --- /dev/null +++ b/src/sonchaeyi/report2/Report2_1 @@ -0,0 +1,9 @@ +//3-1. 다음 중 형변환을 생략할 수 있는 것은? (모두 고르시오) +byte b = 10; +char ch = 'A'; +int i = 100; +long l = 1000L; + +정답 : +float f = (float)l; +i = (int)ch; \ No newline at end of file diff --git a/src/sonchaeyi/report2/Report2_2 b/src/sonchaeyi/report2/Report2_2 new file mode 100644 index 0000000..ae18841 --- /dev/null +++ b/src/sonchaeyi/report2/Report2_2 @@ -0,0 +1,60 @@ +//3-2. 다음 연산의 결과와 그 이유를 적으세요. +class Exercise3_2{ + public static void main(String[] args){ + int x = 2; + int y = 5; + char c = 'A'; // 'A'의 문자코드는 65 + + System.out.println(y >= 5 || x < 0 && x > 2); + - 결과 : true + &&가 ||보다 우선 순위가 높기 때문에 x < 0 && x > 2 먼저 처리. + x < 0 && x > 2 = false + y >= 5 = true + true || false = true + + System.out.println(y += 10 - x++); + - 결과 : 13 + y += 10는 y = y + 10과 같은 의미로 y = 15 + x는 후위형으로 15 - 2를 한 후 3으로 증가 + + System.out.println(x += 2); + - 결과 : 5 + 위에서 x++로 x가 1 증가하여 3이 됨 + 증가한 값에 +2를 하면 5 + + System.out.println(!('A' <= c && c <= 'Z')); + - 결과 : false + 'A'는 아스키코드표에 65이므로 c도 65, 'Z'는 90 + 65 <= 65 && 65 <= 90은 true + !는 not의 의미로 boolean의 값을 반대로 바꿈 + true가 아닌 것은 false이므로 결과는 false + + System.out.println('C' - c); + - 결과 : 2 + 'C'는 아스키코드표에서 67이고 c는 'A'이므로 67 - 65 + + System.out.println('5' - '0'); + - 결과 : 5 + '5'는 아스키코드표에서 53이고 '0'은 48 + 53 - 48 = 5 + + System.out.println(c + 1); + - 결과 : 66 + c는 'A'고 'A'는 아스키코드표에서 65이기 때문에 +1을 하면 66 + + System.out.println(++c); + - 결과 : B + ++c는 전위형이므로 1 증가 후 출력을 함 + c는 'A'고 1 증가 후 66이되므로 'B' + + System.out.println(c++); + - 결과 : B + c++는 후위형이므로 출력 후 1 증가함 + 위에 c가 1 증가해서 66 == 'B'가 출력되고 + 출력 후 1 증가함 + + System.out.println(c); + - 결과 : C + 위에서 후위형으로 1 증가하여 66 + 1 = 67 = 'C'가 됨 + } +} \ No newline at end of file diff --git a/src/sonchaeyi/report2/Report2_3 b/src/sonchaeyi/report2/Report2_3 new file mode 100644 index 0000000..156c16c --- /dev/null +++ b/src/sonchaeyi/report2/Report2_3 @@ -0,0 +1,9 @@ +//3-3. 아래는 변수의 num 값 중에서 백의 자리 이하를 버리는 코드이다. +//만일 변수 num의 값이 '456'이라면 '400'이 되고, '111'이라면 '100'이 된다. +//알맞은 코드를 넣으시오. +class Exercise3_3 { + public static void main(String[] args){ + int num = 456; + System.out.println((num / 100) * 100); + } +} \ No newline at end of file diff --git a/src/sonchaeyi/report2/Report2_4 b/src/sonchaeyi/report2/Report2_4 new file mode 100644 index 0000000..093a0c4 --- /dev/null +++ b/src/sonchaeyi/report2/Report2_4 @@ -0,0 +1,13 @@ +//3-4. 아래의 코드는 사과를 담는데 필요한 바구니(버켓)의 수를 구하는 코드이다. +//만일 사과의 수가 123개이고 하나의 바구니에는 10개의 사과를 담을 수 있다면, 13개의 바구니가 필요할 것이다. +//알맞은 코드를 넣으시오. +class Exercise3_4{ + public static void main(String[] args){ + int numOfApples = 123; // 사과의 개수 + int sizeOfBucket = 10; // 바구니의 크기(바구니에 담을 수 있는 사과의 개수) + int numOfBucket = Math.round((numOfApples / sizeOfBucket) + 0.5f); // 모든 사과를 담는데 필요한 바구니의 수 + + System.out.println("필요한 바구니의 수 :"+numOfBucket); + } +} +//예상 결과 -> 필요한 바구니의 수 :13 \ No newline at end of file diff --git a/src/sonchaeyi/report2/Report2_5 b/src/sonchaeyi/report2/Report2_5 new file mode 100644 index 0000000..b37c549 --- /dev/null +++ b/src/sonchaeyi/report2/Report2_5 @@ -0,0 +1,10 @@ +//3-5. 아래는 변수 num의 값에 따라 '양수', '음수', '0'을 출력하는 코드이다. +//삼항연산자를 이용해서 빈칸에 알맞은 코드를 넣으시오. +//Hint : 삼항 연산자를 두 번 사용할 것! +class Exercise3_5{ + public static void main(String[] args){ + int num = 10; + System.out.println(num > 0 ? "양수" : (num < 0 ? "음수" : "0")); + } +} +//예상 결과 : 양수 \ No newline at end of file diff --git a/src/sonchaeyi/report2/Report2_6 b/src/sonchaeyi/report2/Report2_6 new file mode 100644 index 0000000..acbb37d --- /dev/null +++ b/src/sonchaeyi/report2/Report2_6 @@ -0,0 +1,13 @@ +//3-6. 아래는 화씨(Fahrenheit)를 섭씨(Celcius)로 변환하는 코드이다. +//변환 공식이 'C = 5/9*(F-32)'라고 할 때, 빈 칸에 알맞은 코드를 넣으시오. +// 단, 변환값은 소수점 셋째자리에서 반올림하며, Math.round() 함수를 사용하지 않고 처리할 것! +class Exercise3_6{ + public static void main(String[] args){ + int fahrenheit = 100; + float celcius = (/*빈 칸*/); + + System.out.println("Fahrenheit:"+fahrenheit); + System.out.println("Celcius:"+celcius); + } +} +//예상 결과 : Fahrenheit:100, Celcius:37.78 \ No newline at end of file From 389135164a362cbc07abe7c0c8352032a21cbf6e Mon Sep 17 00:00:00 2001 From: Son-Chaeyi Date: Thu, 19 Jan 2023 21:13:28 +0900 Subject: [PATCH 2/5] =?UTF-8?q?=EC=86=90=EC=B1=84=EC=9D=B4=20=EA=B3=BC?= =?UTF-8?q?=EC=A0=9C=20=EC=A0=9C=EC=B6=9C=ED=95=A9=EB=8B=88=EB=8B=A4.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/sonchaeyi/report3/Report3_1 | 25 +++++++++++++ src/sonchaeyi/report3/Report3_10 | 34 ++++++++++++++++++ src/sonchaeyi/report3/Report3_2 | 13 +++++++ src/sonchaeyi/report3/Report3_3 | 13 +++++++ src/sonchaeyi/report3/Report3_4 | 21 +++++++++++ src/sonchaeyi/report3/Report3_5 | 18 ++++++++++ src/sonchaeyi/report3/Report3_6 | 12 +++++++ src/sonchaeyi/report3/Report3_7 | 14 ++++++++ src/sonchaeyi/report3/Report3_8 | 7 ++++ src/sonchaeyi/report3/Report3_9 | 16 +++++++++ ...4\354\232\260\354\260\250\355\212\270.png" | Bin 0 -> 16566 bytes src/sonchaeyi/report4/Report4_1 | 6 ++++ src/sonchaeyi/report4/Report4_2 | 9 +++++ src/sonchaeyi/report4/Report4_3 | 13 +++++++ src/sonchaeyi/report4/Report4_4 | 25 +++++++++++++ src/sonchaeyi/report4/Report4_5 | 29 +++++++++++++++ src/sonchaeyi/report4/Report4_6 | 32 +++++++++++++++++ 17 files changed, 287 insertions(+) create mode 100644 src/sonchaeyi/report3/Report3_1 create mode 100644 src/sonchaeyi/report3/Report3_10 create mode 100644 src/sonchaeyi/report3/Report3_2 create mode 100644 src/sonchaeyi/report3/Report3_3 create mode 100644 src/sonchaeyi/report3/Report3_4 create mode 100644 src/sonchaeyi/report3/Report3_5 create mode 100644 src/sonchaeyi/report3/Report3_6 create mode 100644 src/sonchaeyi/report3/Report3_7 create mode 100644 src/sonchaeyi/report3/Report3_8 create mode 100644 src/sonchaeyi/report3/Report3_9 create mode 100644 "src/sonchaeyi/report3/\353\241\234\352\267\270\354\235\270 \355\224\214\353\241\234\354\232\260\354\260\250\355\212\270.png" create mode 100644 src/sonchaeyi/report4/Report4_1 create mode 100644 src/sonchaeyi/report4/Report4_2 create mode 100644 src/sonchaeyi/report4/Report4_3 create mode 100644 src/sonchaeyi/report4/Report4_4 create mode 100644 src/sonchaeyi/report4/Report4_5 create mode 100644 src/sonchaeyi/report4/Report4_6 diff --git a/src/sonchaeyi/report3/Report3_1 b/src/sonchaeyi/report3/Report3_1 new file mode 100644 index 0000000..ba1f11c --- /dev/null +++ b/src/sonchaeyi/report3/Report3_1 @@ -0,0 +1,25 @@ +//4-1. 다음의 문장들을 조건식으로 표현해보세요. + +//int형 변수 x가 10보다 크고 20보다 작을 때 true인 조건식 + x > 10 && x < 20 + +//char형 변수 ch가 공백이나 탭이 아닐 때 true인 조건식 + !(ch == ' ' || ch == '\t') + +//char형 변수 ch가 'x' 또는 'X'일 때 true인 조건식 + ch == 'x' || ch == 'X' + +//char형 변수 ch가 숫자('0'~'9')일 때 true인 조건식 + '0' <= ch && ch <= '9' + +//char형 변수 ch가 영문자(대문자 또는 소문자)일 때 true인 조건식 + (ch <= 'a' && ch <= 'z') || (ch < = 'A' && ch <= 'Z') + +//int형 변수 year가 400으로 나눠떨어지거나 또는 4로 나눠떨어지고 100으로 나눠떨어지지 않을때 true인 조건식 + (year % 400 ==0 || year % 4 == 0) && year % 100 != 0 + +//boolean형 변수 powerOn이 false일 때 true인 조건식 + powerOn == false + +//문자열 참조변수 str이 "yes"일 때 true인 조건식 + str.equals("yes") \ No newline at end of file diff --git a/src/sonchaeyi/report3/Report3_10 b/src/sonchaeyi/report3/Report3_10 new file mode 100644 index 0000000..fe61e53 --- /dev/null +++ b/src/sonchaeyi/report3/Report3_10 @@ -0,0 +1,34 @@ +//4-10. 다음은 숫자맞추기 게임을 작성한 것이다. 1과 100사이의 값을 반복적으로 입력해서 +//컴퓨터가 생각한 값을 맞추면 게임이 끝난다. +//사용자가 값을 입력하면, 컴퓨터는 자신이 생각한 값과 비교해서 결과를 알려준다. +//사용자가 컴퓨터가 생각한 숫자를 맞추면 게임이 끝나고 몇 번 만에 숫자를 맞췄는지 알려준다. + +class Exercise4_14 { + public static void main(String[] args) { + // 1~100사이의 임의의 값을 얻어서 answer에 저장한다. + int answer = /*빈 칸*/; + int input = 0; //사용자입력을 저장할 공간 + int count = 0; //시도횟수를 세기위한 변수 + + // 화면으로 부터 사용자입력을 받기 위해서 Scanner클래스 사용 + java.util.Scanner s = new java.util.Scanner(System.in); + do { + count++; + + System.out.print("1과 100사이의 값을 입력하세요 : "); + + input = s.nextInt(); //입력받은 값을 변수 input에 저장한다. + + if(answer > input) { + System.out.println("더 큰 수를 입력하세요."); + } else if(answer < input) { + System.out.println("더 작은 수를 입력하세요."); + } else { + System.out.println("맞혔습니다."); + break; + } + } while(true); //무한반복문 + + System.out.println("시도횟수는 " + count + "번입니다."); + } // end of main +} // end of class \ No newline at end of file diff --git a/src/sonchaeyi/report3/Report3_2 b/src/sonchaeyi/report3/Report3_2 new file mode 100644 index 0000000..7495b9b --- /dev/null +++ b/src/sonchaeyi/report3/Report3_2 @@ -0,0 +1,13 @@ +//4-2. 1부터 20까지의 정수중에서 2 또는 3의 배수가 아닌 수의 총합을 구하세요. +class Exercise4_2 { + public static void main(String[] args) { + int sum = 0; + + for(int i = 0; i < 20; i++) { + if(i % 2 != 0 && i % 3 != 0) { + sum += i; + } + } + System.out.println("sum="+sum); + } +} \ No newline at end of file diff --git a/src/sonchaeyi/report3/Report3_3 b/src/sonchaeyi/report3/Report3_3 new file mode 100644 index 0000000..68ade8f --- /dev/null +++ b/src/sonchaeyi/report3/Report3_3 @@ -0,0 +1,13 @@ +//4-3. 1+(1+2)+(1+2+3)+(1+2+3+4)+...+(1+2+3+...+10)의 결과를 계산하세요. +class Exercise4_3 { + public static void main(String[] args) { + int sum = 0; + int totalSum = 0; + + for (int i = 0; i < 10; i++) { + sum += i; + totalSum += sum; + } + System.out.println("totalSum="+totalSum); + } +} \ No newline at end of file diff --git a/src/sonchaeyi/report3/Report3_4 b/src/sonchaeyi/report3/Report3_4 new file mode 100644 index 0000000..cd93a6b --- /dev/null +++ b/src/sonchaeyi/report3/Report3_4 @@ -0,0 +1,21 @@ +//4-4. 1+(-2)+3+(-4)+...과 같은 식으로 계속 더해나갔을 때, +//몇까지 더해야 총합이 100 이상이 되는지 구하세요. +class Exercise4_4 { + public static void main(String[] args) { + int sum = 0; // 총합을 저장할 변수 + int s = 1; // 값의 부호를 바꿔주는데 사용할 변수 + int num = 0; + + for(int i = 1; true; i++, s =- s) { + num = s * i; + sum += num; + + if(sum >= 100) { + break; + } + } + + System.out.println("num="+num); + System.out.println("sum="+sum); + } +} \ No newline at end of file diff --git a/src/sonchaeyi/report3/Report3_5 b/src/sonchaeyi/report3/Report3_5 new file mode 100644 index 0000000..e527af8 --- /dev/null +++ b/src/sonchaeyi/report3/Report3_5 @@ -0,0 +1,18 @@ +//4-5. 다음의 for문을 while문으로 변경하세요. +public class Exercise4_5 { + public static void main(String[] args) { + int i = 0; + + while (i < 11) { + int j = 0; + + while (j <= i) { + System.out.printf("*"); + j++; + } + + System.out.println(); + i++; + } + }//end of main +} // end of class diff --git a/src/sonchaeyi/report3/Report3_6 b/src/sonchaeyi/report3/Report3_6 new file mode 100644 index 0000000..82aa777 --- /dev/null +++ b/src/sonchaeyi/report3/Report3_6 @@ -0,0 +1,12 @@ +//4-6. 두 개의 주사위를 던졌을 때, 눈의 합이 6이 되는 모든 경우의 수를 출력하는 프로그램을 작성하세요. +class Exercise4_6 { + public static void main(String[] args) { + for (int i = 1; i <= 6; i++) { + for (int j = 1; j <= 6; j++) { + if (i + j == 6) { + System.out.println(i + "+" + j + "=" + (i + j)); + } + } + } + } +} \ No newline at end of file diff --git a/src/sonchaeyi/report3/Report3_7 b/src/sonchaeyi/report3/Report3_7 new file mode 100644 index 0000000..0973fd0 --- /dev/null +++ b/src/sonchaeyi/report3/Report3_7 @@ -0,0 +1,14 @@ +//4-7. 숫자로 이루어진 문자열 str이 있을 때, 각 자리의 합을 더한 결과를 출력하는 코드를 완성하세요. +//만일 문자열이 "12345"라면, ‘1+2+3+4+5’의 결과인 15를 출력이 출력되어야 합니다. +class Exercise4_7 { + public static void main(String[] args) { + String str = "12345"; + int sum = 0; + + for (int i = 0; i < str.length(); i++) { + sum += str.charAt(i) - '0'; + } + + System.out.println("sum=" + sum); + } +}//예상 결과 : sum=15 \ No newline at end of file diff --git a/src/sonchaeyi/report3/Report3_8 b/src/sonchaeyi/report3/Report3_8 new file mode 100644 index 0000000..d9c5670 --- /dev/null +++ b/src/sonchaeyi/report3/Report3_8 @@ -0,0 +1,7 @@ +//4-8. Math.random()을 이용해서 1부터 6 사이의 임의의 정수를 변수 value에 저장하는 코드를 완성하세요. +class Exercise4_8{ + public static void main(String[] args){ + int value = (int) ((Math.random() * 6) + 1); + System.out.println("value:"+value); + } +} \ No newline at end of file diff --git a/src/sonchaeyi/report3/Report3_9 b/src/sonchaeyi/report3/Report3_9 new file mode 100644 index 0000000..843659f --- /dev/null +++ b/src/sonchaeyi/report3/Report3_9 @@ -0,0 +1,16 @@ +//4-9. int 타입의 변수 num이 있을 때, 각 자리의 합을 더한 결과를 출력하는 코드를 완성하세요. +//만일 변수 num의 값이 12345라면, ‘1+2+3+4+5’의 결과인 15를 출력하세요. +//문자열로 변환하지 말고 숫자로만 처리하세요. +public class Exercise4_9 { + public static void main(String[] args) { + int num = 12345; + int sum = 0; + + while(num > 0) { + sum += num % 10; + num /= 10; + } + + System.out.println("sum="+sum); + } +}//예상 결과 : sum=15 \ No newline at end of file diff --git "a/src/sonchaeyi/report3/\353\241\234\352\267\270\354\235\270 \355\224\214\353\241\234\354\232\260\354\260\250\355\212\270.png" "b/src/sonchaeyi/report3/\353\241\234\352\267\270\354\235\270 \355\224\214\353\241\234\354\232\260\354\260\250\355\212\270.png" new file mode 100644 index 0000000000000000000000000000000000000000..c0074e1cb34d0600bd0f7d314c1864ebb6cb1d1d GIT binary patch literal 16566 zcmd6PXIN8B*Dh5s^eTe%CXwDjYC;K+P(pyvd+)u8bm>h%5h((pBo;tX5s)TDQ32^i z1wllbH0h#eczoXTedjwr&fjxgUS#i?*=yFCnLTr_weD@2v7s&vgdIXeL`0*9&_aXX zLLwp(PReuOO7^q*DEJ``M(e_e9t~bvAtE{#9-@s6@r`iv^l>E;l!5=f5|ozo@DC0V zl+hBDmUavX5O?u(bPsa$4Hoxv4FN@<-q+v7)6LV>8lNog4|NhvWYC5)t;pp2%R zB={pKCoZKRYxTFiqr0o$zXIjNC4qp;7M^}C{^7yk(hvjwNJ)ZX85p<%74ouwFC*k- zML>yWK!A^{g{zZ+C+J;APDVjoMjjMjHb7udNI_{hxc2e%b_GAWuFl^6XOF-=g8Y3! ziH?+{k~k3kPoJiaZjM2o|4qc1C1I{X!Jhtp|1m^dQC#k?%B~@f?te?=1KkXR>;r-n z15MmLgMh>^Q{%HXGTLCs{v8`2$@AaQFj8_x>e<`NxElp%Ics795vG2iqqDyJ9Dz>% zjH;lvmY|}xppv4XHe66iOAsb|cA=>ts3<8W^;fonxrd>%TyVIyv80qyh@+ObrboD; zp@+VeQjn3Aet?#@lpz9T8R!9XM(H68!<3ZFB|Q{fWz2#tjImCh&Vte~SEMP@I7CT7 z0WJrR&<1u}7|QDV$XYo|%4%sxdRf2?BQ;H}^n=U|L1TSaBQLDJvyr1*WR$j1vPdIOS!qLffI&!Th`h6;LZG~3 zFvi=>$Vko?36ql#lQf5En+AqiDg}ZbbRvz6<$QIeP(cc&a*`pIQs%yH`kG2s-Uf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X%xIQ)j67A>!;4wd=jk2M6G* zqB^H-+WH$SqqQk~O;xLi#nmXlozni@-ss#h-i|7CZP( z-M5g)^Oaq7ydT;?$AaJDo#NR5UzvR=R(=$p!W&k{-KqE%p6cJTTA~=}BzlweC?>e3 zBPAPS=pJZJiRKN16+P*BHA~cZL4(lzb#0Uv&W7yMGhYrGcG=eo9U0Q~Z*(V~Y=}JvC4GYW1YU`L*$I3p6bv(Xv zHC&wc5Q-k<`@fj`BOm$xW$ts_{yJTgRxo3SlP%<+Z(yzHqJKcm%N8ip0(eUcmK88^ zN7Y-RmN(N`#q^UQER1Bt3_0M-NAQ_SCGarmA3O(Sr_@V*-~eYD0ztwI7rkLbs%tOf zrTEwR&{I literal 0 HcmV?d00001 diff --git a/src/sonchaeyi/report4/Report4_1 b/src/sonchaeyi/report4/Report4_1 new file mode 100644 index 0000000..a635d0b --- /dev/null +++ b/src/sonchaeyi/report4/Report4_1 @@ -0,0 +1,6 @@ +//5-1. 다음은 배열을 선언하거나 초기화한 것이다. 잘못된 것을 고르고 그 이유를 설명하세요. +int[] arr = new int[5]{1,2,3,4,5}; +- {}안의 데이터 개수에 따라 배열의 크기가 자동적으로 결정 + +int arr[5]; +- 배열 선언할 때 크기를 지정 할 수 없음 \ No newline at end of file diff --git a/src/sonchaeyi/report4/Report4_2 b/src/sonchaeyi/report4/Report4_2 new file mode 100644 index 0000000..d1430ce --- /dev/null +++ b/src/sonchaeyi/report4/Report4_2 @@ -0,0 +1,9 @@ +//5-2. 다음과 같은 배열이 있을 때, arr[3].length의 값은? +int[][]arr ={ + {5,5,5,5,5}, + {10,10,10}, + {20,20,20,20}, + {30,30} +}; + +- 답 : 2 ({30,30}) \ No newline at end of file diff --git a/src/sonchaeyi/report4/Report4_3 b/src/sonchaeyi/report4/Report4_3 new file mode 100644 index 0000000..3d38b67 --- /dev/null +++ b/src/sonchaeyi/report4/Report4_3 @@ -0,0 +1,13 @@ +//5-3. 배열 arr에 담긴 모든 값을 더하는 프로그램을 완성하세요. +class Exercise5_3{ + public static void main(String[] args){ + int[] arr = {10, 20, 30, 40, 50}; + int sum = 0; + + for (int i = 0; i < arr.length; i++) { + sum += arr[i]; + } + + System.out.println("sum="+sum); + } +}//예상 결과 : sum=150 \ No newline at end of file diff --git a/src/sonchaeyi/report4/Report4_4 b/src/sonchaeyi/report4/Report4_4 new file mode 100644 index 0000000..d196c3d --- /dev/null +++ b/src/sonchaeyi/report4/Report4_4 @@ -0,0 +1,25 @@ +//5-4. 2차원 배열 arr에 담긴 모든 총합과 평균을 구하는 프로그램을 완성하세요. +class Exercise5_4 { + public static void main(String[] args) { + int[][] arr = { + { 5, 5, 5, 5, 5 }, + { 10, 10, 10, 10, 10 }, + { 20, 20, 20, 20, 20 }, + { 30, 30, 30, 30, 30 } + }; + + int total = 0; + float average = 0; + + for (int i = 0; i < arr.length; i++) { + for (int j = 0; j < arr[i].length; j++) { + total += arr[i][j]; + } + } + + average = total / (float) (arr.length * arr[0].length); + + System.out.println("total=" + total); + System.out.println("average=" + average); + } // end of main +} // end of class \ No newline at end of file diff --git a/src/sonchaeyi/report4/Report4_5 b/src/sonchaeyi/report4/Report4_5 new file mode 100644 index 0000000..530c0f3 --- /dev/null +++ b/src/sonchaeyi/report4/Report4_5 @@ -0,0 +1,29 @@ +//5-5. 다음은 1과 9 사이의 중복되지 않은 숫자로 이루어진 3자리 숫자를 만들어내는 프로그램이다. +//코드를 완성하세요. 다만 Math.random()을 사용했기 때문에 실행 결과 예시와 다를 수 있습니다. +class Exercise5_5{ + public static void main(String[] args) { + int[] ballArr = { 1, 2, 3, 4, 5, 6, 7, 8, 9 }; + int[] ball3 = new int[3]; + + // 배열 ballArr의 임의의 요소를 골라서 위치를 바꾼다 + for (int i = 0; i < ballArr.length; i++) { + int j = (int) (Math.random() * ballArr.length); + int tmp = 0; + + tmp = ballArr[i]; + ballArr[i] = ballArr[j]; + ballArr[j] = tmp; + } + + for (int i = 0; i < 3; i++) { + ball3[i] = ballArr[i]; + } + + // 배열 ballArr의 앞에서 3개의 수를 배열 ball3로 복사한다 + System.arraycopy(ballArr,0, ball3,0,3); + + for (int i = 0; i < ball3.length; i++) { + System.out.print(ball3[i]); + } + }//end of main +}//end of class \ No newline at end of file diff --git a/src/sonchaeyi/report4/Report4_6 b/src/sonchaeyi/report4/Report4_6 new file mode 100644 index 0000000..f646a3b --- /dev/null +++ b/src/sonchaeyi/report4/Report4_6 @@ -0,0 +1,32 @@ +//5-6. 단어의 글자위치를 섞어서 보여주고 원래의 단어를 맞추는 예제이다. +//실행결과와 같이 동작하도록 빈 칸을 채우세요. +import java.util.Scanner; + +class Exercise5_13 { + public static void main(String args[]) { + String[] words = { "television", "computer", "mouse", "phone" }; + + Scanner scanner = new Scanner(System.in); + + for (int i = 0; i < words.length; i++) { + char[] question = words[i].toCharArray(); // String을 char[]로 변환 + + for (int j = 0; j < question.length; j++) { + int index = (int) Math.random() * question.length; + + char temp = question[i]; + question[i] = question[j]; + question[j] = temp; + } + + System.out.printf("Q%d. %s의 정답을 입력하세요 .>", i + 1, new String(question)); + String answer = scanner.nextLine(); + + // trim()으로 answer의 좌우 공백을 제거한 후, equals로 word[i]와 비교 + if (words[i].equals(answer.trim())) + System.out.printf("맞았습니다.%n%n"); + else + System.out.printf("틀렸습니다.%n%n"); + } + } //end of main +}//end of class \ No newline at end of file From 5714492966cec13db354db8154de7e3616f3df88 Mon Sep 17 00:00:00 2001 From: Son-Chaeyi Date: Wed, 25 Jan 2023 00:09:53 +0900 Subject: [PATCH 3/5] =?UTF-8?q?=EC=86=90=EC=B1=84=EC=9D=B4=203=EC=9D=BC?= =?UTF-8?q?=EC=B0=A8=20=EA=B3=BC=EC=A0=9C=20=EC=A0=9C=EC=B6=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/sonchaeyi/report5/Report5_1 | 16 ++++++++ src/sonchaeyi/report5/Report5_2 | 34 ++++++++++++++++ src/sonchaeyi/report5/Report5_3 | 53 +++++++++++++++++++++++++ src/sonchaeyi/report5/Report5_4 | 18 +++++++++ src/sonchaeyi/report5/Report5_5 | 21 ++++++++++ src/sonchaeyi/report6/Report6_1 | 70 +++++++++++++++++++++++++++++++++ src/sonchaeyi/report6/Report6_2 | 16 ++++++++ src/sonchaeyi/report7/Report7_1 | 22 +++++++++++ src/sonchaeyi/report7/Report7_2 | 21 ++++++++++ src/sonchaeyi/report7/Report7_3 | 53 +++++++++++++++++++++++++ src/sonchaeyi/report7/Report7_4 | 26 ++++++++++++ src/sonchaeyi/report7/Report7_5 | 14 +++++++ 12 files changed, 364 insertions(+) create mode 100644 src/sonchaeyi/report5/Report5_1 create mode 100644 src/sonchaeyi/report5/Report5_2 create mode 100644 src/sonchaeyi/report5/Report5_3 create mode 100644 src/sonchaeyi/report5/Report5_4 create mode 100644 src/sonchaeyi/report5/Report5_5 create mode 100644 src/sonchaeyi/report6/Report6_1 create mode 100644 src/sonchaeyi/report6/Report6_2 create mode 100644 src/sonchaeyi/report7/Report7_1 create mode 100644 src/sonchaeyi/report7/Report7_2 create mode 100644 src/sonchaeyi/report7/Report7_3 create mode 100644 src/sonchaeyi/report7/Report7_4 create mode 100644 src/sonchaeyi/report7/Report7_5 diff --git a/src/sonchaeyi/report5/Report5_1 b/src/sonchaeyi/report5/Report5_1 new file mode 100644 index 0000000..24a7583 --- /dev/null +++ b/src/sonchaeyi/report5/Report5_1 @@ -0,0 +1,16 @@ +//6-1. 다음과 같은 멤버 변수를 갖는 Student 클래스를 정의하세요. +//타입 : String, 변수명 : name, 설명 : 학생 이름 +//타입 : int, 변수명 : ban, 설명 : 반 +//타입 : int, 변수명 : no, 설명 : 번호 +//타입 : int, 변수명 : kor, 설명 : 국어 점수 +//타입 : int, 변수명 : eng, 설명 : 영어 점수 +//타입 : int, 변수명 : math, 설명 : 수학 점수 + +class student() { + String name; + int ban; + int no; + int kor; + int eng; + int math; +} \ No newline at end of file diff --git a/src/sonchaeyi/report5/Report5_2 b/src/sonchaeyi/report5/Report5_2 new file mode 100644 index 0000000..700e963 --- /dev/null +++ b/src/sonchaeyi/report5/Report5_2 @@ -0,0 +1,34 @@ +//6-2. 6-1에서 정의한 Student 클래스에 생성자와 info()를 추가해서 실행결과와 같은 결과를 얻도록 하세요. +class Exercise6_2{ + public static void main(String[] args){ + Student s = new Student("홍길동", 1, 1, 100, 60, 76); + + String str = s.info(); + System.out.println(str); + }// 예상 결과 : 홍길동, 1, 1, 100, 60, 76, 236, 78.7 +} + +class Student{ + String name; + int ban; + int no; + int kor; + int eng; + int math; + + Student(String name, int ban, int no, int kor, int eng, int math) { + this.name = name; + this.ban = ban; + this.no = no; + this.kor = kor; + this.eng = eng; + this.math = math; + } + + public String info() { + return name + ", " + ban + ", " + no + "," + + kor + ", " + eng + ", " + math + + ", " + (kor+eng+math) +", " + + ((int) ((kor+eng+math) / 3f * 10 + 0.5f) / 10f); + } +} \ No newline at end of file diff --git a/src/sonchaeyi/report5/Report5_3 b/src/sonchaeyi/report5/Report5_3 new file mode 100644 index 0000000..fe14845 --- /dev/null +++ b/src/sonchaeyi/report5/Report5_3 @@ -0,0 +1,53 @@ +//6-3. 연습문제 6-1에서 정의한 Student 클래스에 다음과 같이 정의된 두 개의 메서드를 추가하세요. +//1. 메서드명 : getTotal +//기능 : 국어(kor), 영어(eng), 수학(math)의 점수를 모두 더해서 반환한다. +//반환타입 : int +//매개변수 : 없음 +//2. 메서드명 : getAverage +//기능 : 총점(국어점수+영어점수+수학점수)을 과목수로 나눈 평균을 구한다. +//소수점 둘째자리에서 반올림할 것. +//반환타입 : float +//매개변수 : 없음 + +class Exercise6_3 { + public static void main(String args[]) { + Student s = new Student(); + s.name = "홍길동"; + s.ban = 1; + s.no = 1; + s.kor = 100; + s.eng = 60; + s.math = 76; + System.out.println("이름 :"+s.name); + System.out.println("총점 :"+s.getTotal()); + System.out.println("평균 :"+s.getAverage()); + }//예상 결과 : 이름 : 홍길동, 총점 : 236, 평균 : 78.7 +} +class Student { + String name; + int ban; + int no; + int kor; + int eng; + int math; + + Student() { + + } + + Student(String name, int ban, int kor, int eng, int math) { + this.name = name; + this.ban = ban; + this.kor = kor; + this.eng = eng; + this.math = math; + } + + int getTotal() { + return kor + eng + math; + } + + float getAverage() { + return (float) Math.round((kor+eng+math) / 3f * 10 + 0.5f) / 10f; + } +} \ No newline at end of file diff --git a/src/sonchaeyi/report5/Report5_4 b/src/sonchaeyi/report5/Report5_4 new file mode 100644 index 0000000..44dbc98 --- /dev/null +++ b/src/sonchaeyi/report5/Report5_4 @@ -0,0 +1,18 @@ +//6-5. 다음의 코드에 정의된 변수들을 종류별(클래스 변수,인스턴스 변수, 지역변수)로 구분해서 적으세요. +class PlayingCard { + int kind; + int num; + static int width; + static int height; + PlayingCard(int k, int n) { + kind = k; + num = n; + } + public static void main(String args[]) { + PlayingCard card = new PlayingCard(1,1); + } +} + +클래스 변수 : width, height +인스턴스 변수 : kind, num +지역 변수 : k, n, card \ No newline at end of file diff --git a/src/sonchaeyi/report5/Report5_5 b/src/sonchaeyi/report5/Report5_5 new file mode 100644 index 0000000..7db3880 --- /dev/null +++ b/src/sonchaeyi/report5/Report5_5 @@ -0,0 +1,21 @@ +//6-7. 다음은 컴퓨터 게임의 병사(marine)를 클래스로 정의한 것이다. +//이 클래스의 멤버 중에 static을 붙여야 하는 것은 어떤 것들이고 그 이유는 무엇인가? +//(단, 모든 병사의 공격력과 방어력은 같아야 한다.) +class Marine { + int x=0, y=0; //Marine의 위치좌표 (x,y) + int hp = 60; //현재 체력 + int weapon = 6; //공격력 + int armor = 0; //방어력 + void weaponUp() { + weapon++; + } + void armorUp() { + armor++; + } + void move(int x, int y) { + this.x = x; + this.y = y; + } +} + +정답 : weapon, armor - 병사들의 공격력과 방어력이 같아야 하기 때문 \ No newline at end of file diff --git a/src/sonchaeyi/report6/Report6_1 b/src/sonchaeyi/report6/Report6_1 new file mode 100644 index 0000000..57bbc64 --- /dev/null +++ b/src/sonchaeyi/report6/Report6_1 @@ -0,0 +1,70 @@ +6-8. 다음 중 생성자에 대한 설명으로 옳지 않은 것은? (모두 고르시오) +a. 모든 생성자의 이름은 클래스의 이름과 동일해야한다. +b. 생성자는 객체를 생성하기 위한 것이다. +c. 클래스에는 생성자가 반드시 하나 이상 있어야 한다. +d. 생성자가 없는 클래스는 컴파일러가 기본 생성자를 추가한다. +e. 생성자는 오버로딩 할 수 없다. + +답: b, e + +6-9. 다음 중 this에 대한 설명으로 맞지 않은 것은? (모두 고르시오) +a. 객체 자신을 가리키는 참조변수이다. +b. 클래스 내에서라면 어디서든 사용할 수 있다. +c. 지역변수와 인스턴스변수를 구별할 때 사용한다. +d. 클래스 메서드 내에서는 사용할 수 없다. + +답: b + +6-10. 다음 중 오버로딩이 성립하기 위한 조건이 아닌 것은? (모두 고르시오) +a. 메서드의 이름이 같아야 한다. +b. 매개변수의 개수나 타입이 달라야 한다. +c. 리턴타입이 달라야 한다. +d. 매개변수의 이름이 달라야 한다. + +답: c, d + +6-11. 다음 중 아래의 add메서드를 올바르게 오버로딩 한 것은? (모두 고르시오) +> long add(int a, int b) { return a+b; } + +a. long add(int x, int y) { return x+y; } +b. long add(long a, long b) { return a+b; } +c. int add(byte a, byte b) { return a+b; } +d. int add(long a, int b) { return (int)(a+b); } + +답: b, c, d + +6-12. 다음 중 초기화에 대한 설명으로 옳지 않은 것은? (모두 고르시오) +a. 멤버변수는 자동 초기화되므로 초기화하지 않고도 값을 참고할 수 있다. +b. 지역변수는 사용하기 전에 반드시 초기화해야 한다. +c. 초기화 블럭보다 생성자가 먼저 수행된다. +d. 명시적 초기화를 제일 우선적으로 고려해야 한다. +e. 클래스변수보다 인스턴스변수가 먼저 초기화된다 + +답: c, e + +6-13. 다음 중 인스턴스변수의 초기화 순서가 올바른 것은? +a. 기본값-명시적초기화-초기화블럭-생성자 +b. 기본값-명시적초기화-생성자-초기화블럭 +c. 기본값-초기화블럭-명시적초기화-생성자 +d. 기본값-초기화블럭-생성자-명시적초기화 + +답: a + +6-14. 다음 중 지역변수에 대한 설명으로 옳지 않은 것은? (모두 고르시오) +a. 자동 초기화되므로 별도의 초기화가 필요없다. +b. 지역변수가 선언된 메서드가 종료되면 지역변수도 함께 소멸된다. +c. 메서드의 매개변수로 선언된 변수도 지역변수이다. +d. 클래스변수나 인스턴스변수보다 메모리 부담이 적다. +e. 힙(heap)영역에 생성되며 가비지 컬렉터에 의해 소멸된다. + +답: a, e + +6-15. 호출스택이 다음과 같은 상황일 때 옳지 않은 설명은? (모두 고르시오) +a. 제일 먼저 호출스택에 저장된 것은 main메서드이다. +b. println메서드를 제외한 나머지 메서드들은 모두 종료된 상태이다. +c. method2메서드를 호출한 것은 main메서드이다. +d. println메서드가 종료되면 method1메서드가 수행을 재개한다. +e. main-method2-method1-println의 순서로 호출되었다. +f. 현재 실행중인 메서드는 println뿐이다. + +답: c \ No newline at end of file diff --git a/src/sonchaeyi/report6/Report6_2 b/src/sonchaeyi/report6/Report6_2 new file mode 100644 index 0000000..bfa8ff3 --- /dev/null +++ b/src/sonchaeyi/report6/Report6_2 @@ -0,0 +1,16 @@ +6-16. 다음 코드의 실행 결과를 예측하여 적어주세요. +class Exercise6_16 { + public static void change(String str) { + str += "456"; + } + + public static void main(String[] args) { + String str = "ABC123"; + System.out.println(str); + change(str); + System.out.println("After change:" + str); + } +} + +답: ABC123 + After change: ABC123 \ No newline at end of file diff --git a/src/sonchaeyi/report7/Report7_1 b/src/sonchaeyi/report7/Report7_1 new file mode 100644 index 0000000..665be94 --- /dev/null +++ b/src/sonchaeyi/report7/Report7_1 @@ -0,0 +1,22 @@ +6-17. 다음과 같이 정의된 메서드를 작성하고 테스트하세요. +class Exercise6_17 { + + private static int[] shuffle(int[] arr) { + for (int i = 0; i < arr.length; i++) { + int j = (int) (Math.random() * arr.length); + + int tmp = arr[i]; + arr[i] = arr[j]; + arr[j] = tmp; + } + return arr; + } + + public static void main(String[] arr) { + int[] original = { 1, 2, 3, 4, 5, 6, 7, 8, 9 }; + System.out.println(java.util.Arrays.toString(original)); + + int[] result = shuffle(original); + System.out.println(java.util.Arrays.toString(result)); + } +} \ No newline at end of file diff --git a/src/sonchaeyi/report7/Report7_2 b/src/sonchaeyi/report7/Report7_2 new file mode 100644 index 0000000..f0a9bf1 --- /dev/null +++ b/src/sonchaeyi/report7/Report7_2 @@ -0,0 +1,21 @@ +6-18. 다음과 같이 정의된 메서드를 작성하고 테스트하세요. +class Exercise6_18 { + + private static boolean isNumber(String str) { + for (int i = 0; i < str.length(); i++) { + char ch = str.charAt(i); + + if(ch < '0' || ch > '9') { + return false; + } + } + return true; + } + + public static void main(String[] args) { + String str = "123"; + System.out.println(str + " 는 숫자입니까? " + isNumber(str)); + str = "1234o"; + System.out.println(str + " 는 숫자입니까? " + isNumber(str)); + } +} \ No newline at end of file diff --git a/src/sonchaeyi/report7/Report7_3 b/src/sonchaeyi/report7/Report7_3 new file mode 100644 index 0000000..afdb19f --- /dev/null +++ b/src/sonchaeyi/report7/Report7_3 @@ -0,0 +1,53 @@ +6-19. Tv클래스를 주어진 로직대로 완성하세요. 완성한 후에 실행해서 주어진 실행결과와 일치하는지 확인하세요. +class MyTv { + boolean isPowerOn; + int channel; + int volume; + final int MAX_VOLUME = 100; + final int MIN_VOLUME = 0; + final int MAX_CHANNEL = 100; + final int MIN_CHANNEL = 1; + void turnOnOff() { + isPowerOn = !isPowerOn; + } + void volumeUp() { + if (volume < MAX_VOLUME) { + volume++; + } + } + void volumeDown() { + if (volume < MIN_VOLUME) { + volume--; + } + } + void channelUp() { + if (channel == MAX_CHANNEL) { + channel = MIN_CHANNEL; + } else { + channel++; + } + } + void channelDown() { + if (channel == MIN_CHANNEL) { + channel = MAX_CHANNEL; + } else { + channel--; + } + } +} + +class Exercise6_19 { + public static void main(String args[]) { + MyTv t = new MyTv(); + t.channel = 100; + t.volume = 0; + System.out.println("CH:" + t.channel + ", VOL:" + t.volume); + t.channelDown(); + t.volumeDown(); + System.out.println("CH:" + t.channel + ", VOL:" + t.volume); + t.volume = 100; + t.channelUp(); + t.volumeUp(); + System.out.println("CH:" + t.channel + ", VOL:" + t.volume); + } +} \ No newline at end of file diff --git a/src/sonchaeyi/report7/Report7_4 b/src/sonchaeyi/report7/Report7_4 new file mode 100644 index 0000000..ab10e80 --- /dev/null +++ b/src/sonchaeyi/report7/Report7_4 @@ -0,0 +1,26 @@ +6-20. 다음과 같이 정의된 메서드를 작성하고 테스트하세요. +class Exercise6_20 { + + private static int max(int[] arr) { + int max = 0; + + if (arr == null || arr.length == 0) { + return -999999; + } else { + for (int i = 0; i < arr.length; i++) { + if (arr[i] > max) { + max = arr[i]; + } + } + } + return max; + } + + public static void main(String[] args) { + int[] data = {3,2,9,4,7}; + System.out.println(java.util.Arrays.toString(data)); + System.out.println("최대값 :"+max(data)); + System.out.println("최대값 :"+max(null)); + System.out.println("최대값 :"+max(new int[]{})); // 크기가 0인 배열 } + } +} \ No newline at end of file diff --git a/src/sonchaeyi/report7/Report7_5 b/src/sonchaeyi/report7/Report7_5 new file mode 100644 index 0000000..4da9f93 --- /dev/null +++ b/src/sonchaeyi/report7/Report7_5 @@ -0,0 +1,14 @@ +6-21. 다음과 같이 정의된 메서드를 작성하고 테스트하시오. +class Exercise6_21 { + + private static int abs(int value) { + return value >= 0 ? value : -value; + } + + public static void main(String[] args) { + int value = 5; + System.out.println(value + "의 절대값 :" + abs(value)); + value = -10; + System.out.println(value + "의 절대값 :" + abs(value)); + } +} \ No newline at end of file From 172d5b09e4d63ed6d54a346d3bc406099696f0cc Mon Sep 17 00:00:00 2001 From: Son-Chaeyi Date: Wed, 25 Jan 2023 14:55:50 +0900 Subject: [PATCH 4/5] =?UTF-8?q?=EC=86=90=EC=B1=84=EC=9D=B4=204=EC=9D=BC?= =?UTF-8?q?=EC=B0=A8=20=EA=B3=BC=EC=A0=9C=20=EC=A0=9C=EC=B6=9C=EC=9E=85?= =?UTF-8?q?=EB=8B=88=EB=8B=A4.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/sonchaeyi/report8/Report8_1 | 47 ++++++++++++++++++++++ src/sonchaeyi/report8/Report8_2 | 71 +++++++++++++++++++++++++++++++++ src/sonchaeyi/report8/Report8_3 | 30 ++++++++++++++ src/sonchaeyi/report8/Report8_4 | 48 ++++++++++++++++++++++ src/sonchaeyi/report8/Report8_5 | 53 ++++++++++++++++++++++++ 5 files changed, 249 insertions(+) create mode 100644 src/sonchaeyi/report8/Report8_1 create mode 100644 src/sonchaeyi/report8/Report8_2 create mode 100644 src/sonchaeyi/report8/Report8_3 create mode 100644 src/sonchaeyi/report8/Report8_4 create mode 100644 src/sonchaeyi/report8/Report8_5 diff --git a/src/sonchaeyi/report8/Report8_1 b/src/sonchaeyi/report8/Report8_1 new file mode 100644 index 0000000..f4096ba --- /dev/null +++ b/src/sonchaeyi/report8/Report8_1 @@ -0,0 +1,47 @@ +7-1. +섯다카드 20장을 포함하는 섯다카드 한 벌(SutdaDeck클래스)을 정의한 것이다. +섯다카드 20장을 담는 SutdaCard배열을 초기화하시오. +단, 섯다카드는 1부터 10까지의 숫자 가 적힌 카드가 한 쌍씩 있고, 숫자가 1, 3, 8인 경우에는 둘 중의 한 장은 광(Kwang)이 어야 한다. +즉, SutdaCard의 인스턴스변수 isKwang의 값이 true이어야 한다. + +class SutdaDeck { + final int CARD_NUM = 20; + SutdaCard[] cards = new SutdaCard[CARD_NUM]; + + SutdaDeck() { + for (int i = 0; i < cards.length; i++) { + int num = i % 10 + 1; + boolean isKwang = (i < 10) && (num == 1 || num ==3 || num == 8); + + cards[i] = new SutdaCard(num, isKwang); + } + } +} + +class SutdaCard { + int num; + boolean isKwang; + + SutdaCard() { + this(1, true); + } + + SutdaCard(int num, boolean isKwang) { + this.num = num; + this.isKwang = isKwang; + } + + // info()대신 Object클래스의 toString()을 오버라이딩했다. + public String toString() { + return num + ( isKwang ? "K":""); + } +} + +class Exercise7_1 { + public static void main(String args[]) { + SutdaDeck deck = new SutdaDeck(); + + for (int i = 0; i < deck.cards.length; i++) + System.out.print(deck.cards[i] + ","); + } +} \ No newline at end of file diff --git a/src/sonchaeyi/report8/Report8_2 b/src/sonchaeyi/report8/Report8_2 new file mode 100644 index 0000000..c93f7ea --- /dev/null +++ b/src/sonchaeyi/report8/Report8_2 @@ -0,0 +1,71 @@ +7-2. 연습문제 7-1. 의 SutdaDeck클래스에 다음에 정의된 새로운 메서드를 추가하고 테스트 하시오. + +class SutdaDeck { + final int CARD_NUM = 20; + SutdaCard[] cards = new SutdaCard[CARD_NUM]; + + SutdaDeck() { + for (int i = 0; i < cards.length; i++) { + int num = i % 10 + 1; + boolean isKwang = (i < 10) && (num == 1 || num ==3 || num == 8); + + cards[i] = new SutdaCard(num, isKwang); + } + } + + void suffle() { + for (int i = 0; i < cards.length; i++) { + int j = (int) (Math.random() * cards.length); + + SutdaCard temp = cards[i]; + cards[i] = cards[j]; + cards[j] = temp; + } + } + + SutdaCard pick(int index) { + if(index < 0 || index >= CARD_NUM) + return null; + return cards[index]; + } + + SutdaCard pick() { + int index = (int) (Math.random() + cards.length); + return pick(index); + } +} + +class SutdaCard { + int num; + boolean isKwang; + + SutdaCard() { + this(1, true); + } + + public SutdaCard(int num, boolean isKwang) { + this.num = num; + this.isKwang = isKwang; + } + + public String toString() { + return num + (isKwang ? "K" : ""); + } +} + +class Main { + public static void main(String[] args) { + SutdaDeck deck = new SutdaDeck(); + + System.out.println(deck.pick(0)); + System.out.println(deck.pick()); + deck.suffle(); + + for (int i = 0; i < deck.cards.length; i++) { + System.out.print(deck.cards[i] + ", "); + } + + System.out.println(); + System.out.println(deck.pick(0)); + } +} \ No newline at end of file diff --git a/src/sonchaeyi/report8/Report8_3 b/src/sonchaeyi/report8/Report8_3 new file mode 100644 index 0000000..60f6df4 --- /dev/null +++ b/src/sonchaeyi/report8/Report8_3 @@ -0,0 +1,30 @@ +7-3. 다음의 코드는 컴파일하면 에러가 발생한다. 그 이유를 설명하고 에러를 수정하기 위해서는 코드를 어떻게 바꾸어야 하는가? + +class Product { + int price; // 제품의 가격 + int bonusPoint; // 제품구매 시 제공하는 보너스점수 + + Product() { //기본생성자 + + } + + Product(int price) { + this.price = price; + bonusPoint = (int) (price / 10.0); + } +} + +class Tv extends Product { + Tv() { + } + + public String toString() { + return "Tv"; + } +} + +class Exercise7_3 { + public static void main(String[] args) { + Tv t = new Tv(); + } +} \ No newline at end of file diff --git a/src/sonchaeyi/report8/Report8_4 b/src/sonchaeyi/report8/Report8_4 new file mode 100644 index 0000000..4eaad41 --- /dev/null +++ b/src/sonchaeyi/report8/Report8_4 @@ -0,0 +1,48 @@ +7-4. MyTv클래스의 멤버변수 isPowerOn, channel, volume을 클래스 외부에서 접근할 수 없도록 제어자를 붙이고 대신 이 멤버변수들의 값을 어디서나 읽고 변경할 수 있도록 getter와 setter메서드를 추가하라. + +class MyTv { + private boolean isPowerOn; + private int channel; + private int volume; + + final int MAX_VOLUME = 100; + final int MIN_VOLUME = 0; + final int MAX_CHANNEL = 100; + final int MIN_CHANNEL = 1; + + public boolean isPowerOn() { + return isPowerOn; + } + + public int getChannel() { + return channel; + } + + public int getVolume() { + return volume; + } + + public void setPowerOn(boolean powerOn) { + isPowerOn = powerOn; + } + + public void setChannel(int channel) { + this.channel = channel; + } + + public void setVolume(int volume) { + this.volume = volume; + } +} + +class Exercise7_4 { + public static void main(String args[]) { + MyTv t = new MyTv(); + + t.setChannel(10); + System.out.println("CH:" + t.getChannel()); + t.setVolume(20); + System.out.println("VOL:" + t.getVolume()); + } +} +//예상결과) CH:10 VOL:20 \ No newline at end of file diff --git a/src/sonchaeyi/report8/Report8_5 b/src/sonchaeyi/report8/Report8_5 new file mode 100644 index 0000000..5b36c21 --- /dev/null +++ b/src/sonchaeyi/report8/Report8_5 @@ -0,0 +1,53 @@ +7-5. 문제7-4에서 작성한 MyTv2클래스에 이전 채널(previous channel)로 이동하는 기능 의 메서드를 추가해서 실행결과와 같은 결과를 얻도록 하시오. + +class MyTv2 { + private boolean isPowerOn; + private int channel; + private int volume; + private int prevChannel; + + final int MAX_VOLUME = 100; + final int MIN_VOLUME = 0; + final int MAX_CHANNEL = 100; + final int MIN_CHANNEL = 1; + + public void setVolume(int volume) { + if (volume > MAX_VOLUME || volume < MIN_VOLUME) + return; + this.volume = volume; + } + + public int getVolume() { + return volume; + } + + public void setChannel(int channel) { + if (channel > MAX_CHANNEL || channel < MIN_CHANNEL) + return; + + prevChannel = this.channel; + this.channel = channel; + } + + public int getChannel() { + return channel; + } + + public void gotoPrevChannel() { + setChannel(prevChannel); + } +} + +class Exercise7_5 { + public static void main(String args[]) { + MyTv2 t = new MyTv2(); + t.setChannel(10); + System.out.println("CH:" + t.getChannel()); + t.setChannel(20); + System.out.println("CH:" + t.getChannel()); + t.gotoPrevChannel(); + System.out.println("CH:" + t.getChannel()); + t.gotoPrevChannel(); + System.out.println("CH:" + t.getChannel()); + } +} \ No newline at end of file From 48a080eaa7bec57310d8dc8c7effd17d5ae1f861 Mon Sep 17 00:00:00 2001 From: Son-Chaeyi Date: Wed, 25 Jan 2023 15:08:11 +0900 Subject: [PATCH 5/5] =?UTF-8?q?=EC=86=90=EC=B1=84=EC=9D=B4=204=EC=9D=BC?= =?UTF-8?q?=EC=B0=A8=20=EA=B3=BC=EC=A0=9C=20=EC=A0=9C=EC=B6=9C=EC=9E=85?= =?UTF-8?q?=EB=8B=88=EB=8B=A4.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/sonchaeyi/report8/Report8_1 | 2 +- src/sonchaeyi/report8/Report8_2 | 2 +- src/sonchaeyi/report8/Report8_3 | 3 ++- src/sonchaeyi/report8/Report8_4 | 3 ++- src/sonchaeyi/report8/Report8_5 | 3 ++- 5 files changed, 8 insertions(+), 5 deletions(-) diff --git a/src/sonchaeyi/report8/Report8_1 b/src/sonchaeyi/report8/Report8_1 index f4096ba..f63340b 100644 --- a/src/sonchaeyi/report8/Report8_1 +++ b/src/sonchaeyi/report8/Report8_1 @@ -1,4 +1,4 @@ -7-1. +7-1. 문제 섯다카드 20장을 포함하는 섯다카드 한 벌(SutdaDeck클래스)을 정의한 것이다. 섯다카드 20장을 담는 SutdaCard배열을 초기화하시오. 단, 섯다카드는 1부터 10까지의 숫자 가 적힌 카드가 한 쌍씩 있고, 숫자가 1, 3, 8인 경우에는 둘 중의 한 장은 광(Kwang)이 어야 한다. diff --git a/src/sonchaeyi/report8/Report8_2 b/src/sonchaeyi/report8/Report8_2 index c93f7ea..c329725 100644 --- a/src/sonchaeyi/report8/Report8_2 +++ b/src/sonchaeyi/report8/Report8_2 @@ -68,4 +68,4 @@ class Main { System.out.println(); System.out.println(deck.pick(0)); } -} \ No newline at end of file +} // \ No newline at end of file diff --git a/src/sonchaeyi/report8/Report8_3 b/src/sonchaeyi/report8/Report8_3 index 60f6df4..f4f21e6 100644 --- a/src/sonchaeyi/report8/Report8_3 +++ b/src/sonchaeyi/report8/Report8_3 @@ -27,4 +27,5 @@ class Exercise7_3 { public static void main(String[] args) { Tv t = new Tv(); } -} \ No newline at end of file +} + diff --git a/src/sonchaeyi/report8/Report8_4 b/src/sonchaeyi/report8/Report8_4 index 4eaad41..de12a7b 100644 --- a/src/sonchaeyi/report8/Report8_4 +++ b/src/sonchaeyi/report8/Report8_4 @@ -45,4 +45,5 @@ class Exercise7_4 { System.out.println("VOL:" + t.getVolume()); } } -//예상결과) CH:10 VOL:20 \ No newline at end of file +//예상결과) CH:10 VOL:20 + diff --git a/src/sonchaeyi/report8/Report8_5 b/src/sonchaeyi/report8/Report8_5 index 5b36c21..5143024 100644 --- a/src/sonchaeyi/report8/Report8_5 +++ b/src/sonchaeyi/report8/Report8_5 @@ -50,4 +50,5 @@ class Exercise7_5 { t.gotoPrevChannel(); System.out.println("CH:" + t.getChannel()); } -} \ No newline at end of file +} +