Reputation: 23
I currently have this set up to display credit card inputs and outputs:
static void ViewReport(ArrayList paymentReport) //Displays the current payments in a list
{
//Activated if the user hits the v or V key
Console.WriteLine("\n{0,-5}{1,-25}{2,-15}{3,-15}{4,-15}", "Plan", "Number", "Balance", "Payment", "APR");
foreach (PaymentPlan creditCard in paymentReport)
{
Console.WriteLine("{0,-5}{1,-25}{2,-15}{3,-15}{4,-15}",
creditCard.PlanNumber,
creditCard.CardNumber,
creditCard.CreditBalance,
creditCard.MonthlyPayment,
creditCard.AnnualRate);
}
}
I have to create a separate method that needs to sort creditCard.CreditBalance
from lowest to highest. So which would be the best way the sort the list by creditCard.CreditBalance
which would then reflect the ViewReport
the next time the user opens it again?
Upvotes: 2
Views: 71