Skip to content

CodingBat-Logic1-redTicket #262

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
divinedragon opened this issue Jun 30, 2017 · 0 comments
Open

CodingBat-Logic1-redTicket #262

divinedragon opened this issue Jun 30, 2017 · 0 comments

Comments

@divinedragon
Copy link
Owner

divinedragon commented Jun 30, 2017

Write code and JUnit test cases for CodingBat-Logic1-redTicket

Url - http://codingbat.com/prob/p170833

Problem Statement:

You have a red lottery ticket showing ints a, b, and c, each of which is 0, 1, or 2. If they are all the value 2, the result is 10. Otherwise if they are all the same, the result is 5. Otherwise so long as both b and c are different from a, the result is 1. Otherwise the result is 0.

redTicket(2, 2, 2) → 10
redTicket(2, 2, 1) → 0
redTicket(0, 0, 0) → 5

Expected method declaration

public int redTicket(int a, int b, int c) {
}
@divinedragon divinedragon changed the title CodingBat-Logic1-maxMod5 CodingBat-Logic1-redTicket Oct 25, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant