본문 바로가기
반응형

2016/0512

2016-05-22_조재찬_스터디일지-C# 클래스 복습 try~catch 문 try 블록과 각각 다른 예외의 처리기를 지정하는 하나 이상의 catch 절로 구성 아래의 소스는 실행시 에러와 함께 종료된다. using System; namespace TryCatchText { class Program { static void Main(string[] args) { int a, b, c; a = 10; b = 0; c = a / b; Console.WriteLine(c); } } } 실행시 에러가 뜨면서 프로그램 종료 try~catch문을 통해 예외문구를 출력하게하고 비정상 종료를 막을 수 있다.1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 using System; namespace TryCatchTe.. 2016. 5. 22.
2016-05-20_조재찬_스터디일지-C# 메소드와 클래스 복습 메소드 오버로딩 int Plus(int a, int b) { return a + b; } double Plus(doubl a, double b) { return a + b; } // int result1 = Plus(1, 2); double result2 = Plus(3.1, 2.4); 새로운 이름을 붙이지않고 하나의 메소드 이름에 여러개의 구현을 올림. 이름에 대한 고민을 줄여주고 코드의 일관성을 유지해주며, 생산성을 높인다. 객체지향 프로그래밍 객체는 데이터와 메소드로 이루어진다. : 속성은 데이터(변수), 기능은 메소드 Class는 객체를 만들기위한 청사진 붕어빵 틀이 클래스, 붕어빵은 객체 class 클래스 이름 { // 데이터와 메소드 } 고양이를 추상화하기 class Cat { public s.. 2016. 5. 20.
이름 #include #include #define CLR 0x01 // Clear Display 명령 #define HOME 0x02 // Return Home 명령 #define FNC 0x38 // Function Set 명령 // Data Length 8 bit, 행수 2행 #define RIGHT 1 #define LEFT 0 void LCD_PortSetting(void) { DDRC = 0xFF; // 데이터 라인 DDRD = 0xFF; // 0 ~ 2 제어 핀 사용 // D0: Rs, D1: R/W, D2: En } void IR_Write(unsigned char Data) { PORTD &= 0xFC; // RS = 0, Write Enable _delay_us(1); // Enable 까지.. 2016. 5. 20.
2016-05-19_조재찬_업무일지_ AVR-LCD출력 & C#-성적관리 프로그램 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 #include #include #define CLR 0x01 //Clear Display 명령 #define HOME 0x02 //Return Home 명령 #define FNC 0x38 //Function Set 명령 //Data Length = 8bit. 행수 2행 void LCD_PortSetting(void) { DDRC = 0xFF; //데이터 .. 2016. 5. 20.
2016-05-18_조재찬_스터디일지_ C#-설문조사 APP, 기초복습 설문조사 APP 구현 Form 디자인 제출버튼(btnPoll)을 클릭했을때의 코드 추가/*foreach (컬렉션의 요소를 반복하는데 사용되는 변수 in Object 변수){// 실행문;}*/ 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 private void btnPoll_Click(object sender, EventArgs e) { if(this.CB1.Checked!=false||this.CB2.Checked!=false) { foreach(RadioButton c in this.GB_Hobby.Controls) { if (c.Checked == true) this.Label_Hobby.Text = c.Text; } this.Label_Singer.Text .. 2016. 5. 19.
2016-05-18_조재찬_업무일지_ C#-OOP와 클래스 c# - plus,minus OP 프로젝트-OP_CLS.cs1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace OP { public class OP_CLS { public string PLUS(string a, string b) { string temp = (int.Parse(a) + int.Parse(b)).ToString(); return temp; } public string MINUS(string a, string b) { s.. 2016. 5. 18.
2016-05-17_조재찬_업무일지_AVR 입출력/ C#메소드 7 segment 숫자와 알파벳 출력 캐소드 구동방식은 FND의 세그먼트중 켜길 원하는 비트가 0, 끄길 원하는 비트가 1이 된다. 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 #include #include int main(void) { unsigned char fnd[16] = {0xC0, 0xF9, 0xA4, 0xB0, 0x99, 0x92, 0x82, 0xd8, 0x80, 0x90, 0x88, 0x83, 0xC6, 0xA1, 0x86, 0x8E}; volatile unsigned char i; DDRF=0xFF; while(1) { for(i=0; i 2016. 5. 17.
2016-05-16_조재찬_업무일지_AVR 입출력/ C#기초 proteus에서 회로도 그리고 아래 소스를 시뮬레이션 avr studio에서 컴파일시 Frequency 설정할 것 hex파일을 프로그램으로 올려줌 7 Segment - up & down 카운트 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 #include #include int main(void) { unsigned char a; DDRA = 0x00;// A 포트는 입력으로 사용, 생략 가능 DDRB = 0xFF;// B 포트는 출력으로 사용 DDRC = 0xFF;/.. 2016. 5. 16.
칸 아카데미 암호학 강좌 칸 아카데미의 암호학 강좌라고 하는데... 물론 영어입니다; 게다가 암호학...ㄷㄷㄷ https://www.khanacademy.org/computing/computer-science/cryptography 2016. 5. 14.
728x90
반응형