The world’s Largest Sharp Brain Virtual Experts Marketplace Just a click Away
Levels Tought:
Elementary,Middle School,High School,College,University,PHD
| Teaching Since: | May 2017 |
| Last Sign in: | 398 Weeks Ago, 6 Days Ago |
| Questions Answered: | 66690 |
| Tutorials Posted: | 66688 |
MCS,PHD
Argosy University/ Phoniex University/
Nov-2005 - Oct-2011
Professor
Phoniex University
Oct-2001 - Nov-2016
Joel and Neha have been working to balance the CS Club's finances. They have a stack of tickets, each containing the date and amount of money spent, and they need to process them. However, they each prefer to process them in a different order. Joel wishes to process them in order of the greatest expense to the smallest expense, while Neha wishes to process them starting with the oldest expense and ending with the most recent. Create a program that will take in a list of dates and expenses and then print out both ways of ordering the tickets..
Â
Â
Â
A list of tickets values and dates. Each ticket will have a number and a date in MM/DD/YY format. The list will terminate with -1.
Â
Â
Money: followed by each ticket in order stating with the greatest expense. After that, Date: followed by each ticket starting in order starting with the oldest.
Â
Input: 10 01/01/01 5 01/03/01 15 03/02/02 -1 Output: Money: [15, 03/02/02] [10, 01/01/01] [5, 01/03/01] Date: [10, 01/01/01] [5, 01/03/01] [15, 03/02/02]
Hel-----------lo -----------Sir-----------/Ma-----------dam-----------Tha-----------nk -----------You----------- fo-----------r u-----------sin-----------g o-----------ur -----------web-----------sit-----------e a-----------nd -----------and----------- ac-----------qui-----------sit-----------ion----------- of----------- my----------- po-----------ste-----------d s-----------olu-----------tio-----------n.P-----------lea-----------se -----------pin-----------g m-----------e o-----------n c-----------hat----------- I -----------am -----------onl-----------ine----------- or----------- in-----------box----------- me----------- a -----------mes-----------sag-----------e I----------- wi-----------ll