Skip to content

Instantly share code, notes, and snippets.

@super-fishz
Created March 28, 2019 10:04
Show Gist options
  • Save super-fishz/ffcd0a24b4e686e5be36cbe272d87457 to your computer and use it in GitHub Desktop.
Save super-fishz/ffcd0a24b4e686e5be36cbe272d87457 to your computer and use it in GitHub Desktop.
TDD Injection, 0328 과제 interface
/*
아래 개념이 모두 동작하게 코드를 작성해주세요.
5dallar = 5dallar
5dallar + 5 dallar = 10dallar
5000krw + 5000krw = 10000krw
5000krw + 5dallar = 10dallar
10dallar = 10000krw
평소에 tdd를 하셧으면 tdd로 짜셔도 되고,
unit test를 짜면서 만드셨으면 unit test 가 있어도 되고,
test가 없어도 좋습니다
*/
/*
아래 인터페이스는 완전한 인터페이스가 아닙니다.
상황에 따라 interface가 바뀔 수 있어요.(어쩌면 interface가 필요하지 않을지도)
*/
interface Dallar {
Dallar equals(Dallar d);
Dallar plus(Dallar d);
}
interface Krw {
Krw equals(Krw k);
Krw plus(Krw k);
}
interface Money {
}
interface SomethingElse {
}
@dev-juyoung
Copy link

요구사항에 오류가 있는 것으로 판단되어 변경합니다.

1. $5는 ₩5,000과 같다.
2. $10는 ₩10,000과 같다.
3. $5$5를 더한 결과는 $10이다.
4.5,000와 ₩5,000를 더한 결과는 ₩10,000이다.
5. $5와 ₩5,000을 더한 결과는 $10이다.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment