PSEUDO CODE FOR EXPENSE TRACKER:
Here are each methods with its pseudo code.
1. HAVE AN ACCOUNT :
START : This is the start of Have an account method
Function SIGNUP()
PassIn: String representing username
String representing password
IF username and password == NULL
Add username and password to database
START : This is the start of LOGIN method
Function : LOGIN()
PassIn: String representing username
String representing password
IF (username and password != NULL && combo matches pair in database)
\\ input given by the user matches the data in database \\
Call Credentials_authorization()
Re-route user to dashboard
ELSEIF LOGIN() failed
Reroute user to welcome page
ELSE
Log bad login attempt
Show error message
reroute it to login page.
END IF
PassOut: nothing
Call SIGN UP()
Call LOGIN()
2. CHECK CREDENTIALS:
This module is to check the credentials (input) given by the user correct or not.The input of the
module is the credentials entered by the user. This function checks whether the input entered
by user matches with data in database .If it matches it will validate and reroutes user to dashboard.
START : This is the start of Credentials authorization method
Function Credentials_authorization ()
PassIn : String and integer[var-char] representing email_id
String and integer[var-char] representing password
Validate
submit to database;
IF (email_id and password == Values of email_id and password in DB)
Re-route user to DASHBOARD
ELSE
Display “ENTER DATA CORRECTLY”
End IF.
PassOut : nothing
Call Credentials_authorization ()
3. USER PROFILE :
START: This is the start of User profile method
Function DisplayUsername ()
PassIn: String representing Username
Display Username from Database
Pass Out: Username
Endfunction
Function DisplayEmail_id ()
PassIn: String and integer[var-char] representing email_id
Display Email_id from Database
Pass Out: email_id
Endfunction
Function DisplayPassword ()
PassIn: String and integer[var-char] representing password
Display the Password from database
Pass Out: password
Endfunction
Function Logout ()
PassIn: nothing
Direct the application to Welcome page
Pass Out: nothing
call DisplayUsername
call DisplayEmail_id
call DisplayPassword
4. DISPLAY INCOME :
START: This is the start of DisplayIncome method
Function DisplayIncome ()
PassIn: Integer representing Income
Display the integer entered by the user from database
Pass Out: Income
Endfunction
call DisplayIncome
5. INCOME LIST
Edit income:
START : This is the start of Edit Income method
Function Edit_Income()
Pass In : String representing income_name
Integer representing income_amount in the input field.
FOR all income_amount > 0
Search the id and income_amount selected by the user.
Assign the desired integer to the income_amount
update income_amount
END FOR
on Edit_Income() submit
validate
if errors
show errors;
else
submit to database;
if (edit==success)
show ui success;
else
show ui fail;
END IF
Add Income:
START : This is the start of Add Income method
Function Add_Income(object)
Pass In :String representing income_name
Integer income_amount.
IF (income name== null)
assign the id to that object
Enter income name
Enter income amounts
id ++
on Add_Income()submit
validate
if errors
show errors;
else
submit to database;
if (add==success)
show ui success;
else
show ui fail;
END IF
Delete Income:
START : This is the start of Delete Income method
Function Delete_Income()
Pass In: String representing income_name.
For each ( search income name )
If (id of income_name in database == selected id by the user)
delete the income_name
PassOut : nothing
Save Income:
START: This is the start of Save income method
Function Save_Income()
Pass In : nothing
Save the changes and updations
on Save_Income() submit
validate
if errors
show errors;
else
submit to database;
if (save==success)
show ui success;
else
show ui fail;
PassOut : nothing
Call Edit_Income()
Call Save_Income()
Call Delete_Income()
Call Add_Income()
6. EXPENSE LIST
Edit expense:
START : This is the start of Edit Expense method
Function Edit_Expense()
Pass In : String representing expense_name
Integer representing expense_amount in the input field.
FOR all expense_amount > 0
Search the id and expense_amount selected by the user.
Assign the desired integer to the expense_amount
update expense_amount
END FOR
on Edit_Expense() submit
validate
if errors
show errors;
else
submit to database;
if (edit==success)
show ui success;
else
show ui fail;
END IF
Add Expense:
START : This is the start of Add Expense method
Function Add_Expense(object)
Pass In :String representing expense_name
Integer expense_amount.
IF (expense name== null)
assign the id to that object
Enter expense name
Enter expense amounts
id ++
on Add_Expense()submit
validate
if errors
show errors;
else
submit to database;
if (add==success)
show ui success;
else
show ui fail;
END IF
Delete Expense:
START : This is the start of Delete Expense method
Function Delete_Expense()
Pass In: String representing expense_name.
For each ( search expense name )
If (id of expense_name in database == selected id by the user)
delete the expense_name
PassOut : nothing
Save Expense:
START: This is the start of Save expense method
Function Save_Expense()
Pass In : nothing
Save the changes and updations
on Save_Expense() submit
validate
if errors
show errors;
else
submit to database;
if (save==success)
show ui success;
else
show ui fail;
PassOut : nothing
Call Edit_Expense()
Call Save_Expense()
Call Delete_Expense()
Call Add_Expense()
7. VIEW BALANCE :
START : This is the start of DisplayBalence method
Function DisplayBalance ()
PassIn: nothing
WHILE (id>0)
Add all the expense amounts and store it in total_expense.
Subtract total_expense from Income
store the result in integer representing Balance
Display Balance
Pass Out: Balance
Endfunction
call DisplayBalence()
8.VIEW GRAPH :
START : This is the start of View Graph method
Function ViewGraph()
PassIn: nothing
IF (pie chart is supported)
use pie chart
End IF
Display expenses vs the time pie chart.
PassOut : nothing
Endfunction
Call ViewGraph()
Comments
Post a Comment