CLASS/C# 3

[C#] 2022.10.12 문장, 후위 연산 후 수식 결과 출력 (C# Postfix 코드)

[실습] 예제 3-1 ~ 3-23 연습문제 3.6 ~ 3.9 후위 연산으로 변경 후 수식 계산 (stack 이용) 1. 3+4*2 2. 3*4-2/1 using System; using System.Collections.Generic; using System.Text; namespace HelloWorld { class Assignment1App { static void Main() { Console.Out.Write("수식 입력 : "); string input = Console.In.ReadLine(); input = PostFix(input); // 수식을 PostFix 방식으로 변환 Console.Out.WriteLine("Postfix : " + input); // PostFix 후 결과 출력 ..

CLASS/C# 2022.10.12

[C#] 2022.09.21 클래스, 문장

# 클래스와 객체 클래스의 구성 : 필드, 메소드 필드 - 상수 정의, 필드, 이벤트 메소드 - 메소드, 생성자, 소멸자, 프로퍼티, 인덱서, 연산자 중복 # 문장의 종류 infix exp, postfix exp, prefix exp P.160 4-1 객체 생성 using System; using System.Collections.Generic; using System.Text; namespace HelloWorld { class Fraction { int numerator; // 분자 int denominator; // 분모 public Fraction(int num, int denom) { // 생성자 numerator = num; denominator = denom; } public void Pri..

CLASS/C# 2022.09.21

[C#] 2022.09.14 C# 개요 및 실습

# 닷넷 프로그래밍 처음 실행하기 (실행 : Ctrl + F5) # C#의 특징 MS사의 앤더스 헬스버그(Anders Hejlsberg)가 고안 .NET에 최적화 자바의 단점을 보완 객체지향 언어: 자료 추상화 델리게이트와 이벤트 멀티스레드, 예외처리 연산자 중복, 제네릭 중간 1번 문제 은행 거래하는 프로그램 작성 # 기본 특징 i) C#의 자료형 값형(value type) 참조형(reference type) ii) 숫자형 - 정수형 signed – sbyte, short, int, long unsigned – byte, ushort, uint, ulong - 실수형 – float, double, decimal iii) 형 검사 연산자(type testing operator) is – 호환 가능한지를 ..

CLASS/C# 2022.09.14