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: | Apr 2017 |
| Last Sign in: | 103 Weeks Ago, 2 Days Ago |
| Questions Answered: | 4870 |
| Tutorials Posted: | 4863 |
MBA IT, Mater in Science and Technology
Devry
Jul-1996 - Jul-2000
Professor
Devry University
Mar-2010 - Oct-2016
C++ Help!!!
Input
The input is one or more plain-text files. In any input file, each line is terminated with an end-of-line character. Each line will have a fixed set of data, separated by the tab character (that is, t). Lines that start with the symbol # should be considered comments and therefore skipped. There may be empty lines in the input file; such lines should be skipped.
Example 1:
Meredith Invoice PARK-1203 Jackson Approve-reservation 7634 Amelia Approve-reservation 7658 Jackson Invoice DISC-7303 Callie Approve-travel TR-N208-TX Arizona Invoice DISC-7304(Cancelled) # this line is a comment because it starts with # Owen Approve-purchase-order D-9076 Miranda Purchase-order-revise D-9076 Arizona Invoice DISC-7304(Cancelled) Meredith Invoice PARK-1205 Cristina Invoice TECH-3030 Owen Approve-purchase-order D-9077 Callie Invoice DISC-7294 Callie Invoice DISC-7294 Amelia Approve-reservation 7664 Callie Invoice DISC-7294 Cristina Invoice TECH-2980(Cancelled) Jackson Invoice DISC-7343 Callie Approve-travel TR-N209-TX Meredith Invoice TECH-3034 Owen Approve-purchase-order D-9078 Amelia Approve-reservation 7669 Miranda Purchase-order-cancellation D-9076 Amelia Approve-reservation(Cancelled) 7669 Callie Review-invoice DISC-7304
Each line that is not a comment (or empty line) will always have three items. The first is the person receiving the notification. The second item is the subject line of the email. The third is the 'body' of the email message.
For the purpose of the assignment, we will pretend that another part of a notification system will replace the name for the actual email, and there will be a nicely formatted email message created automatically from the other information of each line.
Program specification
The main program should be called notify and the syntax in which it will be tested is as follows:
./notify "input=FILENAME"
The parameter input specifies the name of the input file.
Example of program calls:
./notify "input=uh-gray.1.txt"
The source code will be compiled as follows:
g++ -std=c++11 -o notify -I ./ *.cpp
Rules to combine notifications:
Rules to combine input files:
Output
Your program will output to the console (such as via cout) with the results of combining notifications. Your program must follow the output format exactly to facilitate automated grading (and to avoid failing test cases due to things such as output of an empty line at the end).
Output for the input example 1.
Meredith Invoice PARK-1203, PARK-1205, TECH-3034 Jackson Approve-reservation 7634 Amelia Approve-reservation 7658, 7664 Jackson Invoice DISC-7303, DISC-7343 Callie Approve-travel TR-N208-TX, TR-N209-TX Arizona Invoice DISC-7304(Cancelled) Cristina Invoice TECH-3030, TECH-2980(Cancelled) Owen Approve-purchase-order D-9077, D-9078 Callie Invoice DISC-7294 Miranda Purchase-order-cancellation D-9076 Callie Review-invoice DISC-7304
Input File is attached here
Â
MeredithInvoicePARK-1203JacksonApprove-reservation7634AmeliaApprove-reservation7658JacksonInvoiceDISC-7303CallieApprove-travelTR-N208-TXArizonaInvoiceDISC-7304(Cancelled)# this line is a comment because it starts with #OwenApprove-purchase-orderD-9076MirandaPurchase-order-reviseD-9076ArizonaInvoiceDISC-7304(Cancelled)MeredithInvoicePARK-1205CristinaInvoiceTECH-3030OwenApprove-purchase-orderD-9077CallieInvoiceDISC-7294CallieInvoiceDISC-7294AmeliaApprove-reservation7664CallieInvoiceDISC-7294CristinaInvoiceTECH-2980(Cancelled)JacksonInvoiceDISC-7343CallieApprove-travelTR-N209-TXMeredithInvoiceTECH-3034OwenApprove-purchase-orderD-9078AmeliaApprove-reservation7669MirandaPurchase-order-cancellationD-9076AmeliaApprove-reservation(Cancelled)7669CallieReview-invoiceDISC-7304
Attachments: