Giter Club home page Giter Club logo

camp_calculator's Introduction

📱 Calculator assignment

필수 구현 기능

Lv1

  • 더하기, 빼기, 나누기, 곱하기 연산을 수행할 수 있는 Calculator 클래스를 만들기
  • 클래스를 이용하여 연산을 진행하고 출력하기

Lv2

  • Lv1에서 만든 Calculator 클래스에 출력 이후 추가 연산을 가능하도록 코드를 추가
  • 연산 진행 후 출력하기
  • Lv1에서 만든 Calculator 클래스에 나머지 연산자(%)를 추가하기
  • -1을 입력 할 때까지 계산을 반복, -1 입력 시 반복 종료 구현
  • 콘솔에서 (1번 +, 2번 -, 3번 *, 4번 /, 5번 %)을 입력하면 연산 진행

Lv3

  • AddOperation(더하기), SubstractOperation(빼기), MultiplyOperation(곱하기), DivideOperation(나누기) 연산 클래스 만들기
  • 클래스간의 관계를 고려하여 사칙연산 클래스와 Calculator 클래스 관계 맺기
  • 관계를 맺은 후 필요하다면 Calculator 클래스의 내부 코드를 변경하기
  • 나머지 연산자(%) 기능은 제외
  • Lv2 와 비교하여 어떠한 점이 개선 되었는지 스스로 생각 - 클래스의 책임(단일책임원칙)

선택 구현 기능

Lv4

  • AddOperation(더하기), SubtractOperation(빼기), MultiplyOperation(곱하기), DivideOperation(나누기)
    연산 클래스들을 AbstractOperation라는 클래스명으로 만들어 사용하여 추상화하고 Calculator 클래스의 내부 코드를 변경
  • Lv3 와 비교해서 어떠한 점이 개선 되었는지 스스로 생각 - 클래스간의 결합도, 의존성(의존성역전원칙)

Lv5

  • Lv4 이후 기능 추가 (예: 3개 이상의 수 연산 시 우선 순위(+-/x%), 괄호 사용 시 우선 순위)

생각 및 의견

  • Lv5는 나중에 Stack와 후위 연산에 대해 공부를 한 뒤 다시 구현
  • Null 처리와 try catch throw에 대한 고민이 필요

camp_calculator's People

Contributors

xeejin avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.