Split-liang is an application that helps you split expenses with friends in a fun way! If you are tired of keeping track and calculating who owes who, Split-liang is here to help you. With Split-liang, you can create groups, add members, add expenses, and settle debts between members. Split-liang will automatically calculate the amount each member owes or is owed. You can also play slots to remove your debts!
help
create
enter
delete group
member
exit
expense
list
delete expense
balance
settle
luck
bye
Split-liang
from here.cd
to the folder where the jar file is located. Run the command java -jar Split-liang.jar
. The application should start and display the welcome message.A command has the general format:
COMMAND ARGUMENT /param PARAM1 /param PARAM2 ...
help
This command will display a message explaining how to use the application.
Format: help
Example: help
Output:
Welcome, here is a list of commands:
help: Access help menu.
create <name>: Create a group.
exit <name>: Exit current group.
member <name> : Add a member to the group.
expense <description> /amount <amount> /currency <currency> /paid <paid_by> /user <user_1> /user <user_2> ...: Add an expense SPLIT EQUALLY.
expense <description> /unequal /amount <amount> /currency <currency> /paid <paid_by> /user <user_1> <amount_owed> /user <user_2> <amount owed> ...: Add an expense SPLIT UNEQUALLY.
list: List all expenses in the group.
balance <user_name>: Show user's balance.
settle <payer_name> /user <payee_name>: Settle the amount between two users.
luck <payer_name>: luck is in the air tonight
create
Creates a new group with the specified group name.
Format: create GROUP_NAME
GROUP_NAME
is the name of the group.GROUP_NAME
can contain whitespaces but cannot be empty.GROUP_NAME
must be unique. It cannot be the same as an existing group name.GROUP_NAME
is not case-sensitive.GROUP_NAME
cannot contain special characters.Example: create Friends
This command will create a new group named ‘Friends’.
enter
Enters an existing group with the specified group name.
Format: enter GROUP_NAME
GROUP_NAME
is the name of the group.GROUP_NAME
must be an existing group name.Example: enter Friends
This command will enter the group named ‘Friends’.
delete group GROUP_NAME
Deletes an existing group with the specified group name.
Format: delete group GROUP_NAME
GROUP_NAME
is the name of the group to be deleted.GROUP_NAME
must be an existing group name.Example: delete group Friends
member
Adds a new member to the group.
Format: member USER_NAME
USER_NAME
is the name of the user to be added to the group. It is in alphanumeric format.USER_NAME
must be unique. It cannot be the same as an existing member’s name.USER_NAME
can contain whitespaces but cannot be empty.USER_NAME
is not case-sensitive.USER_NAME
can contain special characters.Example: member Alice
This command will add a new member named ‘Alice’ to the group.
Output: Alice has been added to group.
exit
Exits the current group.
Format: exit GROUP_NAME
GROUP_NAME
is the name of the group.
«««< HEADGROUP_NAME
must be an existing group.Example: exit Friends
This command will exit the group named ‘Friends’.
expense
Create a new expense for a given group.
Format:expense DESCRIPITON /amount AMOUNT /paid PAYER_USER_NAME /user USER_NAME /user USER_NAME
PAYER_USER_NAME
is the username of the person who paid for the transaction.USER_NAME
is the username of payees. Each expense can have multiple payees but only one payer.AMOUNT
has to be a valid float value. It will be split equally between all members including the payer.AMOUNT
value entered is greater than 2 decimal places, it will round off to 2 decimal places before calculating split.AMOUNT
is from 0.01 to 999999.99.PAYER_USER_NAME
) and all payees (USER_NAME
) must be existing members of the group.
Otherwise, exception will be thrown.Examples:
expense dinner /amount 9.00 /paid Alice /user Bob /user Charlie
This command will create a new expense with total amount of SGD 9.00 with a split of:
Alice: SGD 3.00, Bob: SGD 3.00, and Charlie: SGD 3.00.
expense lunch /amount 10.00 /paid Alice /user Bob /user Charlie
This command will create a new expense with total amount of SGD 10 with a split of:
Alice: SGD 3.33, Bob: SGD 3.33, and Charlie: SGD 3.33.
Expenses with unequal split and Expense with different currencies take in the base parameters of Expenses split equally plus one additional parameter. All the rules mentioned for equally split expenses still apply.
Format:expense DESCRIPITON /unequal /amount TOTAL_AMOUNT
/paid PAYER_USER_NAME /user USER_NAME AMOUNT_OWED /user USER_NAME AMOUNT_OWED
/unequal
indicates that the expense will be split according to the AMOUNT_OWED
by each user.Examples:
expense dinner /unequal /amount 9.00 /paid Alice /user Bob 3 /user Charlie 4
This command will create a new expense with total amount of SGD 9.00 with a split of:
Alice: SGD 2.00, Bob: SGD 3.00, and Charlie: SGD 4.00 (Alice’s split is automatically calculated)
expense dinner /unequal /amount 14.00 /paid Alice /user Bob 5 /user Charlie 6
This command will create a new expense with total amount of SGD 14 with a split of:
Alice: SGD 3.00, Bob: SGD 5.00, and Charlie: SGD 6.00 (Alice’s split is automatically calculated)
Format: expense DESCRIPTION /currency CURRENCY /amount TOTAL_AMOUNT
/paid PAYER_USER_NAME /user USER_NAME AMOUNT_OWED /user USER_NAME AMOUNT_OWED
/currency
indicates the currency of the transaction./currency
is present in the command, the program will use SGD as the default currency.Examples:
expense dinner /currency USD /unequal /amount 9.00 /paid Alice /user Bob 3 /user Charlie 4
This command will create a new expense with total amount of USD 9.00 with a split of:
Alice: USD 2.00, Bob: USD 3.00, and Charlie: USD 4.00 (Alice’s split is automatically calculated)
expense dinner /amount 9.00 /paid Alice /user Bob /user Charlie
This command will create a new expense with total amount of USD 9.00 with a split of:
Alice: USD 3.00, Bob: USD 3.00, and Charlie: USD 3.00
list
Lists all expenses for the current group
Format: list
delete expense
to delete an expense (see below).delete expense
Deletes an expense based on index specified from list command.
Format: delete expense LIST_INDEX
LIST_INDEX
needs to be a valid index from the Expenses list. To check expenses list use the list
command
(see above).LIST_INDEX
does not exist, an exception will be thrown.LIST_INDEX
starts from 1.LIST_INDEX
has to be an integer value.Example:
delete expense 3
balance
Shows list of members the user owes money to.
Format: balance USER_NAME
USER_NAME
is the name of the user whose balance is to be displayed.USER_NAME
must be an existing member of the group.Example:
balance Alice
/\_/\
( ^.^ )
> ^ <
<----------SUCCESS----------->
User Alice's Balance List:
Bob : 5.00SGD
Eve : 10.00SGD
Eve : -10.00AUD
End of Balance List
<---------------------------->
This command will display the balance of the user named Alice.
In this case, Bob owes Alice 5.00SGD
,
Eve owes Alice 10.00SGD
and Alice owes Eve 10.00AUD
settle
Settles the expenses between two users in the group.
Format: settle USER_NAME1 /user USER_NAME2
USER_NAME1
is the name of the first user.USER_NAME2
is the name of the second user./user
is a keyword to indicate the start of the second user’s name.Example: settle Alice /user Bob
This command will settle the expenses between Alice and Bob, showing what Alice owes Bob.
luck USER_NAME1
Play slots to remove debts
Format: luck USER_NAME1
`
/reroll
to reroll the slots/exit
to exit the slot machine/reroll
This command enable users play slots to remove their debts
Split-liang automatically saves the data in each group to GROUP_NAME.txt
in the data\groups
folder after the user exits the group using the exit GROUP_NAME
command or exits the application using the bye
command. There is no need to save manually.
The group data is loaded automatically when the user enters the group using the enter GROUP_NAME
command.
X
button on the window. It will also not be saved when the application is closed using the Ctrl + C
command in the terminal.bye
This command exits the application.
Currency | Tag to Enter (This is what should be entered after /currency ) when creating new expense |
---|---|
US Dollar | USD e.g. /currency USD |
Singapore Dollar | SGD e.g. /currency SGD |
Chinese Yuan | RMB e.g. /currency RMB |
Euro | EUR e.g. /currency EUR |
Japanese Yen | JPY e.g. /currency JPY |
Australian Dollar | AUD e.g. /currency AUD |
Malaysian Ringgit | MYR e.g. /currency MYR |
create group
command followed by the group name.data
folder to the new device to transfer your data.Action | Format, Examples |
---|---|
Help | help |
Create group | create GROUP_NAME e.g. create Friends |
Enter group | enter GROUP_NAME e.g. enter Friends |
Delete group | delete group GROUP_NAME e.g. delete group Friends |
Add member | member USER_NAME e.g. member Alice |
Exit group | exit GROUP_NAME e.g. exit Friends |
Add expense | expense DESCRIPTION /amount AMOUNT /paid USER_NAME /user USER_NAME GROUP_NAME e.g. expense lunch /amount 20 /paid Alice /user Bob |
List expenses | list e.g. list |
Delete expense | delete expense LIST_INDEX e.g. delete expense 3 |
Balance | balance USER_NAME e.g. balance Alice |
Settle expenses | settle USER_NAME1 /user USER_NAME2 e.g. settle Alice /user Bob |
Luck | luck USER_NAME1 e.g. luck Alice |
Exit application | bye |