Skip to content
This repository was archived by the owner on May 18, 2022. It is now read-only.

Splitwise design#10

Open
rkyadaviitkgp wants to merge 1 commit intoworkattech:masterfrom
rkyadaviitkgp:master
Open

Splitwise design#10
rkyadaviitkgp wants to merge 1 commit intoworkattech:masterfrom
rkyadaviitkgp:master

Conversation

@rkyadaviitkgp
Copy link
Copy Markdown

No description provided.

*/
public class Balance {

Map<Integer, Double> pay;
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

better names?


public void split(List<User> l1){

User PaidByUSer = l1.get(0);
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

camelCase?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

public void split(List users) {
User paidByUser = users.get(0);

super(amount);
}

public void split(List<User> l1){
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

better variable name?
users?

public void split(List<User> l1){

User PaidByUSer = l1.get(0);
double divamount = getAmount()/l1.size();
Copy link
Copy Markdown
Collaborator

@gcnit gcnit Oct 4, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

camelCase: divAmount

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

or a better name?

SHOW

*/
public static void main(String[] args) {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

keep in different class

@gcnit
Copy link
Copy Markdown
Collaborator

gcnit commented Oct 4, 2019

@rkyadaviitkgp sorry for the delay! Was busy at work.

Code looks good! Need to work on variable names. Also instead of keeping balances at the user level, better to keep it at a central place.

Gave a few comments. Please check.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants