Loading...

Messages

Proposals

Stuck in your homework and missing deadline? Get urgent help in $10/Page with 24 hours deadline

Get Urgent Writing Help In Your Essays, Assignments, Homeworks, Dissertation, Thesis Or Coursework & Achieve A+ Grades.

Privacy Guaranteed - 100% Plagiarism Free Writing - Free Turnitin Report - Professional And Experienced Writers - 24/7 Online Support

How to count in c++

28/10/2021 Client: muhammad11 Deadline: 2 Day

Write Linux Program In C++ Using Pipes Binary I/O And Other Functions

Pipes Binary I/O Regex Subtotals

Write a Linux program in C++ to do the following:

Set up pipe:

1) Call fork() to create a parent/child setup.

2) Set up a pipe between parent and child so that the parent is the producer and the child is the consumer.

3) The interlacing of messages printed by different processes will depend on the timing of your program and does not have to match the sample output. However, individual messages should not be broken up. Prevent this using the same method as in HW2:

a) Issue the cout << unitbuf command at the beginning of your program.

b) Use only use one extraction operator (“<<”) to print each message, using ostringstream or equivalent to build the message before printing and using \n instead of endl to avoid using a second extraction operator.

Parent processing:

1) Read input file from the file specified a the command line parameter. If no parameter is given, use as a default ~t90rkf1/d480/dhw/hw3-air/resv.txt. A smaller test file named resv0.txt is available.

2) For each record do the following:

a) Print the input record.

b) Write the data to the pipe as a C-string (i.e., with a terminator).

c) Print the same data and its length (not including the terminator).

3) At the end of the file, print a count of the number of input records read.

Child processing:

1) Read each entry as follows:

a) Read the C-string.

c) Break the entry into fixed-length fields and save the fields in a vector of pointers to objects, just as in HW1.

2) Use regular expressions to break the input record into individual entries. Build keys with fixed-length fields.

3) Use a sort function to sort the entries by date, flight number, city pair, last name and first name. A city pair consists of an origin and destination city. Date, flight number and city pair determine a flight leg. Use a sequence-preserving sort so that the same input will always produce the same output. For a vector, that is the stable_sort function. The record locator (= airline lingo for reservation ID) is printed but is not a sort key, since it doesn’t matter to anyone but the passenger.

4) Print the entries with subtotals by flight leg, flight number, date, year/month, and grand total. For example:

2014 September 26 WN 123 BWI-FLL ABC499 Mouse, Mickey

2014 September 26 WN 123 BWI-FLL 1 * Passengers this leg

2014 September 26 WN 123 MDW-BWI ABC478 Kelly, Gary

WN 123 MDW-BWI ABC456 Kelly, Mary

2014 September 26 WN 123 MDW-BWI 2 * Passengers this leg

2014 September 26 WN 123 3 ** Passengers all legs

2014 September 26 3 *** Date total

2014 September 27 WN 123 FLL-MSY ABC499 Mouse, Mickey

2014 September 27 WN 123 FLL-MSY 1 * Passengers this leg

2014 September 27 WN 123 1 ** Passengers all legs

2014 September 27 1 *** Date total

2014 September 4 **** Month total

2014 October 1 WN 123 FLL-MSY ABC487 Mouse, Mickey

2014 October 1 WN 123 FLL-MSY 1 * Passengers this leg

2014 October 1 WN 123 1 ** Passengers all legs

2014 October 1 1 *** Date total

2014 October 1 **** Month total

5 ***** Grand total

Leave a space before each total line except the flight leg total. Note that detail lines after the first one in the same first-level group (i.e., for the same leg) have their keys suppressed. Not printing these keys makes the output easier to read.

Make sure that all of your columns line up and that you print suitable information on each total line.

Your TA may use a different file to test your program.

Hints:
Use the man command to learn the usage of the following system calls and user functions.

pipe( ) read( ) write( )

The following files were used in class to demonstrate binary I/O.

~t90rkf1/d480/dio/dbinary/*.cpp

Remember that you will need to write a loop that reads multiple records from a binary file. The man page for read explains how to tell when end of file has been reached for a binary file.

The following files were used in class to illustrate subtotal processing:

~t90rkf1/d480/sub3.cpp single-level subtotal processing

~t90rkf1/d480/msub1.cpp multi-level subtotal processing

~t90rkf1/d480/sub-pseudo.cpp pseudocode explanation of subtotal processing

Some examples of building a comparison function for a sort can be found here:

~t90rkf1/d480/dsort/*.cpp

Further detail about regular expression processing in C++ can be found in this example as well as others in the same directory, especially regex2d.cpp.

~t90rkf1/d480/dregex/*.cpp

Testing suggestions:
Write your program in the following order. Make sure each part works correctly before you go on to the next.

1. First, make sure that you can read the input correctly and write it to a physical binary file.

2. Second, make sure that you can read your physical binary file correctly and print the detail lines.

3. Then combine your two pieces of code, replacing the physical file with a pipe.

4. Finally, add the total processing.

Style requirements:
Do not use printf, sprintf, character arrays or other features which belong to C style rather than C++. You can use a character array where required as the input to a system call.

Submission instructions:
Same rules as in previous assignments, including the following:

Whenever you issue a system call such, make sure to check for error and terminate, e.g., exit(-1), if the system call fails.

Submit a zip file named hw3-xxxx.cpp, where xxxx is your 4‑letter ID, containing hw3.cpp, the source file for your class (and any other source files you create) and a makefile.

Business case:
The purpose of the detail lines and the “passengers this leg” total is to allow the gate agents to track passenger loading and the passenger load.

The purpose of the “passengers all legs” field is to track business by flight.

The purpose of the date, month and grand totals are to track business on a seasonal basis. More people travel in the summer than in the winter. In addition, the month right after summer vacation, i.e., September, has the lowest totals of all. Most airlines permit reservations 364 days in advance.

Note that none of the above allow the copany to see how many people would be inconvenienced if the complete flight was cancelled. For that, cross-cutting totals starting with locator number are required.

Grading rubric:
20 points: fork and pipe handling

20 points: input processing and binary I/O

20 points: building objects and sorting

20 points: output processing: printing detail lines

20 points: output processing: printing total lines

Homework is Completed By:

Writer Writer Name Amount Client Comments & Rating
Instant Homework Helper

ONLINE

Instant Homework Helper

$36

She helped me in last minute in a very reasonable price. She is a lifesaver, I got A+ grade in my homework, I will surely hire her again for my next assignments, Thumbs Up!

Order & Get This Solution Within 3 Hours in $25/Page

Custom Original Solution And Get A+ Grades

  • 100% Plagiarism Free
  • Proper APA/MLA/Harvard Referencing
  • Delivery in 3 Hours After Placing Order
  • Free Turnitin Report
  • Unlimited Revisions
  • Privacy Guaranteed

Order & Get This Solution Within 6 Hours in $20/Page

Custom Original Solution And Get A+ Grades

  • 100% Plagiarism Free
  • Proper APA/MLA/Harvard Referencing
  • Delivery in 6 Hours After Placing Order
  • Free Turnitin Report
  • Unlimited Revisions
  • Privacy Guaranteed

Order & Get This Solution Within 12 Hours in $15/Page

Custom Original Solution And Get A+ Grades

  • 100% Plagiarism Free
  • Proper APA/MLA/Harvard Referencing
  • Delivery in 12 Hours After Placing Order
  • Free Turnitin Report
  • Unlimited Revisions
  • Privacy Guaranteed

6 writers have sent their proposals to do this homework:

Innovative Writer
Assignment Guru
Instant Assignments
Quality Homework Helper
Helping Hand
Top Essay Tutor
Writer Writer Name Offer Chat
Innovative Writer

ONLINE

Innovative Writer

I will provide you with the well organized and well research papers from different primary and secondary sources will write the content that will support your points.

$22 Chat With Writer
Assignment Guru

ONLINE

Assignment Guru

I am a PhD writer with 10 years of experience. I will be delivering high-quality, plagiarism-free work to you in the minimum amount of time. Waiting for your message.

$47 Chat With Writer
Instant Assignments

ONLINE

Instant Assignments

I have read your project description carefully and you will get plagiarism free writing according to your requirements. Thank You

$24 Chat With Writer
Quality Homework Helper

ONLINE

Quality Homework Helper

As an experienced writer, I have extensive experience in business writing, report writing, business profile writing, writing business reports and business plans for my clients.

$39 Chat With Writer
Helping Hand

ONLINE

Helping Hand

I am an experienced researcher here with master education. After reading your posting, I feel, you need an expert research writer to complete your project.Thank You

$50 Chat With Writer
Top Essay Tutor

ONLINE

Top Essay Tutor

I reckon that I can perfectly carry this project for you! I am a research writer and have been writing academic papers, business reports, plans, literature review, reports and others for the past 1 decade.

$37 Chat With Writer

Let our expert academic writers to help you in achieving a+ grades in your homework, assignment, quiz or exam.

Similar Homework Questions

Ph of fruit punch - Our iceberg is melting characters review - Nursing informatics infographic - Short answers - Dab auto jetinox 110 mx - Blue eyes brown eyes study - The heavenly christmas tree pdf - 1 peter 3 15 nkjv - Classicmodels database download - A company's realized strategy is made up of - Spanish alphabet pronunciation sheet - Practice with taxonomy and classification worksheet answers - Faraday ice pail and charge production lab report - HSA 551 week 100 - What is Evidence-Based Practice? - Split ring connector design - Box of biscuits tongue twister - Who determines ethical standards for advertising - Www agendaweb org verbs - Similarities between virtue theory utilitarianism and deontological ethics - Ethics and accountability in public administration - Initiating the Project-2 - Lambeau field pro nyt crossword - DNP-DPI Project- QUALITY IMPROVEMENT PROJECT - Comrey & lee 1992 - Jci standards 7th edition pdf free download - 675 bridge inn road doreen - Douglas water treatment plant - 1.6 km run norms - Juke a chicago story season 2 episode 9 - Database proposal - Write each fraction in simplest form 6 10 - Nursing Leadership DB#10 (Chapter 12) - Presentation on storage devices - 200-300 word answer - Is yuriatin a real town in russia - How to measure dna ladder - Games at twilight full text - Rubrics for reporting in science - NUR601- REPLY TO DISCUSSION RUTH - Nursing Leadership and Management - How to separate salt from water without heat - ConferenceRegistrationForm-02 , -VaccinationSchedule-04, WD2016-Capstone- - Anthology of world scriptures 9th edition pdf - My Choice Medical Center +27835179056 Prime cure SAFE ABORTION PILLS IN Mahlabatini Nongoma Paulpietersburg Ulundi DUBAI limpopo - Lord and lady montague - Hp-ux 11i v3 end of support - Zam zams menu elland - Self leveling cement canadian tire - ORGN BEHVR Problem Set #12 - 3 1/6 as a improper fraction - Participant information sheet questionnaire - Cardiff university law school - We don't actually touch anything - 10-1 Discussion: Going Forward - What are the capacity implications of the marketing campaign - Neurology royal victoria hospital - Essay on field trip to museum - Research Paper - Excel chapter 4 grader project - Federal safeguards for financial reporting abuse - Microprocessor - Wgu data driven decision making task 1 - Information technology in Global Economy - A broad differentiation strategy enhances company profitability whenever - Short-Writing #3 - Isbn 978 1 259 17649 4 - Elenco digital analog trainer - Calisthenics 12 week program - How to calculate cp in excel - Permanent income hypothesis graph - Denver international airport runway concrete - Mirabilis jalapa in marathi - Post2 - Change readiness assessment template prosci - Business Risk Management questions - As/nzs 4360:2004 risk management - Www trendymanage com - Final paper - Everyman's way of the cross - Blackboard old westbury - Incremental approach in public policy - Bow's notation graphical method - Who is mr avery in to kill a mockingbird - Seinfeld pudding skin episode - Centrelink rockingham opening hours - Safe operating procedure template - To Understand Low Paying Salaries & Advocate For Higher Paying Salaries In The Field of Social Work - Set 1 relative humidity answers - Taguchi design of experiments ppt - Stakeholders (Internal & External) - The product design group of iyengar electric supplies - PPT 10 slides with Note - Wakefield council tax number - The yellow wallpaper active reading chart answers - Cat in animal farm - Dhcs ca gov services medi cal pages countyoffices aspx - Edward scissorhands old kim - Case study series on work life balance in large organizations - Improving the Lives of Impoverished Women