Expense Manager
Note : Use the collections (whi)
Menu
1. Add Income
2. Add Expense
3. Account Summary
Add Income
Take following As Input
1. Predefined Category Selection :
2. Title
3. Amount
4. Date
Add Expense
Take following As Input
1. Predefined Category Selection
2. Title
3. Amount
4. Date
Account Summary
show output : Category | Title | Amount | Date
1. Expense
1. Sort by date
2. Sort by name
3. Group by category
2. Income
1. Sort by date
2. Sort by name
3. Group by category
3. Total
show output
Total Income :
Total Expense :
I want help in above red Marked part of the assignment. that is sorting part, I used arrary, so I have to sort array, I found help for sort the list of DateTime, but Can I convert array to List and sort, please help me regarding Sorting part, attached the Source Code, Hope by that code will get proper exact reply.


VulpesRank #55 · 29.2K reputationPosted Jul 14, 2014, 6:47 AM EDT
As you're only reading in a 2 x 2 array (rather than 5 x 4) for testing purposes, I've included a where clause in the sorting routine to ensure that only non-null elements are sorted. You'll get an exception otherwise.
The program still needs some work to make it robust - there's no 'quit' option for example.
Also, I'd avoid using goto (which is not considered 'nice' in C# programming circles) when there are other ways to easily achieve the same thing (while or do loops).
Guest UserRank #259 · 9.8K reputationPosted Jul 13, 2014, 8:37 PM EDT
Aditya PatilRank #2,485 · 565 reputationPosted Jul 13, 2014, 8:39 PM EDT
Aditya PatilRank #2,485 · 565 reputationPosted Jul 13, 2014, 8:47 PM EDT
Can you give me part of sorting of Income / Expense part so I can complete remaining part.
Ramesh MaruthiRank #937 · 2.2K reputationPosted Jul 13, 2014, 8:58 PM EDT
Did u tried with the linq ?
Once look at this links
http://www.informit.com/guides/content.aspx?g=dotnet&seqNum=777
http://social.msdn.microsoft.com/Forums/vstudio/en-US/a8e9ee18-07aa-4f62-9dd1-e2341cd94b85/linq-multi-dimesnional-array?forum=csharpgeneral
http://stackoverflow.com/questions/18896150/c-sharp-linq-return-a-multidimensional-array-from-linq
Converting array to list
http://stackoverflow.com/questions/5132397/fast-way-to-convert-a-two-dimensional-array-to-a-list-one-dimensional
http://bytes.com/topic/c-sharp/answers/882073-list-lists-multidimension-array
Aditya PatilRank #2,485 · 565 reputationPosted Jul 13, 2014, 9:05 PM EDT
Ramesh MaruthiRank #937 · 2.2K reputationPosted Jul 13, 2014, 9:12 PM EDT
Aditya PatilRank #2,485 · 565 reputationPosted Jul 13, 2014, 9:35 PM EDT
VulpesRank #55 · 29.2K reputationPosted Jul 14, 2014, 2:32 AM EDT
DateTime[] idateSorted = idate.Cast
or, if you want the results in a List instead:
List
Aditya PatilRank #2,485 · 565 reputationPosted Jul 14, 2014, 2:44 AM EDT
And when I write Console.WriteLine();
It displays Program.DateTime[] on Console. Not display the dates, and other related columns.
VulpesRank #55 · 29.2K reputationPosted Jul 14, 2014, 3:38 AM EDT
Aditya PatilRank #2,485 · 565 reputationPosted Jul 14, 2014, 4:22 AM EDT
What to print, Problem is in Printing, can you give me code for my problem from starting of sort to print it, it will be beneficial, as its urgent i have to complete it today itself, as soon as I can complete the part of Sorting under Expense I will learn and at same way complete the Sorting under Income part, So telling you all, please give me code for the Red Marked content, and also specify the code what to print, main problem is under Print.
Aditya PatilRank #2,485 · 565 reputationPosted Jul 14, 2014, 8:24 AM EDT
Now I understood complete what have to exactly for sorting and all. :)