You are on page 1of 1

start

float totalincome=0

float totalexpense=0

float totalsavings=0

float totalbal=0

float gsavings

float gexpense

float cps=0

float cpe=0

float gps=0

float gpe=0

int percentage=100

 char ipurpose [MAX_STRINGS][STRING_LENGTH], idate [MAX_STRINGS][STRING_LENGTH]

 char epurpose [MAX_STRINGS][STRING_LENGTH], edate [MAX_STRINGS][STRING_LENGTH]

 char spurpose [MAX_STRINGS][STRING_LENGTH], sdate [MAX_STRINGS][STRING_LENGTH]

int a,b,c,numinc,numexp,numsave

float income[30], expense[30], savings [30]

float smessage=0

float emessage=0
expensex
incomex

int option, another , p goal char x


char y

printf(Input your number of income) printf(Input your number of income)


goal printf(What is your savings goal in percentage?)

int b=0
int a =0
g=0 printf(What is your expense goal in percentage?)

False a<numinc b<numexp


if(gexpense+gsavings==percentage printf(Please try again  ) False
True False
True
if (gsavings+gexpense!=percentage) goal True
True
printf("Enter date %d(mm/dd/yy): ",b+1)
printf("Enter date %d(mm/dd/yy): ",a+1)

False printf(Your Goal Percentage for savings is: )

printf("Enter Purpose:  ",b+1)


printf("Enter amount: ",a+1)
printf("ENTER THE OPTION BELOW") 
printf(Your Goal Percentage for expenses is: )
printf("Enter amount: ",b+1)
printf("Enter Purpose:  ",a+1)
printf("1. INSERT INCOME")
totalexpense = totalexpense + expense[b]
End
totalincome = totalincome + income[a]
printf("2. INSERT EXPENSE")
b++
a++

printf("3.INSERT SAVINGS")

printf(Your total income is: )


printf("4. VIEW TOTALSEB") printf(Your total expense is: )

printf("Date             Transaction       Amount       


 Purpose" )
printf("5. VIEW CURRENTPERCENTAGE")  printf("Date             Transaction       Amount       
 Purpose" )
a=0

printf("6. VIEW OVERALL RECORD") b=0

printf("7. EXIT") a<numinc


b<numexp

True

option printf("%d.%s                 Income %d            %.2f        %s\n",a+1,idate[a],a+1,income[a],ipurpose[a]        True

printf("%d.%s                 Expense%d            %.2f        %s\n",b+1,idate[b],b+1,income[b],ipurpose[b]       


True 
a++
case 1 printf( "INSERT INCOME") incomex break
b++

End
End
case 2 printf( "INSERT EXPENSE") expensex break

savingsx

case 3 printf(" INSERT SAVINGS") savingsx break


currenpercentage spendhabits
totalseb
char z

cps= totalsavings/totalincome*100
case 4 printf( "INSERT TOTAL") totalseb break total = totalincome-totalsavings-totalexpense
printf(Input your number of savings: )
printf(---------You're a good saver------) cps>gsavings&&cpe<gexpense

cpe= totalexpense/totalincome*100 True


int c=0 printf(Total Income: )

case 5 printf( "CURRENT PERCENTAGE") currentpercentage spendhabits  break False


printf(Current Percentage for Savings is : )
printf(Total Expense: )

c<numsave printf(Current Percentage for Expense is : ) cps<gsavings&&cpe>gexpense


False
False printf(Total Savings: ) True
case 6  printf("OVERALL RECORD") overall break
True
printf(**GOAL***)
printf("Enter date %d(mm/dd/yy): ",c+1) printf(---------You're overspender------)
printf(Total Balance: )
cps==gsavings&&cpe==gexpense
gps= totalsavings/totalincome*100-gsavings True False
printf("Enter Purpose:  ",c+1)
End
gpe= totalexpense/totalincome*100-gexpense
option!=7 printf("Enter amount: ",c+1) printf(---------You're neglecting your tracking duty-----)
printf(---------You're a disciplined spender------) Text

smessage = gsavings-cps
False
totalsavings = totalsavings + savings[c]

emessage = gexpense-cpe
End
c++

End
printf(Your total savings  is: ) printf(Savings: )

printf("Date             Transaction       Amount       


 Purpose" )
printf(You meet the goal!!! )
True cps=gsavings overall
c=0

False

False printf("GOAL")

cps<gsavings printf(You are exceeding your goal..... )


c<numsave

printf("Savings")
True

printf("%d.%s                 Savings %d            %.2f        %s\n",c+1,idate[c],c+1,income[c],ipurpose[c]       


 printf("   You are lacking %.2f%% or %.2f to your goal\n\n",smessage,smessage/100*totalincome);
printf("Expenses")
}

c++
printf("Current Percentage")
printf(Expense: )

End printf("Total Income")

printf("Total Savings")
printf(You meet the goal!!! ) cpe =  gexpense

True

False
printf(You meet the goal!!! ) cps==gsavings
True

cps<gsavings  printf(" You are overspending %.2f%% or %.2f of your goal.....\n\n",emessage,emessage/100*totalincome);)


False False

True
cps<gsavings printf("You are lacking %.2f or .%.2f to your goal" )
True

printf("You still have %.2f%% or %.2f to spend\n\n",emessage,emessage/100*totalincome);) False

printf(You are exceeding your goal..... )

End
printf(Total Expenses Php          %10.2f               %10.2f%%                   %10.2f%%",totalexpense,cpe,gpe))

printf(You meet the goal!!! ) cpe==gexpense


True

False

printf(" You still have %.2f%% or %.2f to spend\n",emessage,emessage/100*totalincome" )


cpe<gexpense
True

False

printf("  You are overspending %.2f%% or %.2f of your goal.....\n",emessage,emessage/100*totalincome" )

printf(Total Balance  Php          %10.2f\n\n",totalbal)

printf("Date             Transaction       Amount         Purpose" )

a=0

b=0
False
a<numinc

True
c=0 False
b<numexp
printf("  " Income %d                       %.2f                              %s\n",idate[a],a+1,income[a],ipurpose[a] )

True

a++
c<numsave printf("  " Income %d                       %.2f                              %s\n",idate[b],b+1,income[b],ipurpose[b] )
False

True
b++

printf("  " Income %d                       %.2f                              %s\n",idate[c],c+1,income[c],ipurpose[c] )

c++

End

You might also like