You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
void current_report(data spendings[], int size, double sum_income, double sum_expense) //Get the current report.
{
for(int i=1; i<size; i++)
{
for(int j=0; j<(size-1);j++)
{
if(spendings[j].date > spendings[j+1].date) //Sort the data by date.
{
swap(spendings[j], spendings[j+1]);
}
}
}
cout<<"Your current report is: "<<endl;
for (int i=0;i<size;++i){
cout<<setw(3)<<spendings[i].date<<setw(9)<<spendings[i].type<<setw(10)<<spendings[i].category<<setw(11)<<spendings[i].method<<setw(11)<<spendings[i].amount<<endl; //Print the current report sorted by date.