CS 10C Programming Concepts and Methodologies 2 2021/10/13 下午10:41 CS 10C Programming Concepts and Methodologies 2 https://daveteaches.com/10c/a9.shtml 1/2 CS 10C Programming Concepts and...

1 answer below »
NOTE: 1. You CAN't copy answers from online. You have to do it by yourself. When submitting the assignment, the expert should submit a separate form of statement to prove that they didn't copy aswers from online sources. 2. Must submit before the deadline!


CS 10C Programming Concepts and Methodologies 2 2021/10/13 下午10:41 CS 10C Programming Concepts and Methodologies 2 https://daveteaches.com/10c/a9.shtml 1/2 CS 10C Programming Concepts and Methodologies 2 Assignment 9: Queues Skip to Main Content Assignment 9.1 [5 points] Do Exercise 11 from chapter 13 of the text. Assignment 9.2 [40 points] Do Programming Problem 6 from chapter 13 of the text. The problem says to "use a link-based implementation for the priority queue," but we will instead be using the STL priority queue. I would recommend using cplusplus.com as your reference for queues and priority queues. You'll be writing a function named "simulate()". main() will be nothing more than just a call to the function. Please place all of your code in a single file for this part of the assignment. Hints: You'll have to read section 13.4 of the text carefully. I created a class named "Event" and a class named "Customer". I made all of the data members public, in order to make the task simpler. (You can do the same.) Maybe I should have just made them structs. There were no member functions in either class, except for operator<() in="" the="" event="" class="" (see="" below).="" in="" order="" to="" use="" the="" stl="" priority_queue="" class,="" your="" event="" class="" will="" need="" to="" define="" an=""><() function.="" this="" is="" how="" the="" priority_queue="" class="" will="" compare="" your="" events="" to="" determine="" which="" ones="" have="" higher="" priority.="" events="" with="" earlier="" times="" should="" have="" a="" greater="" priority.="" let="" me="" say="" more="" about="" this,="" in="" case="" it="" seems="" mysterious.="" somewhere="" in="" the="" code="" for="" the="" stl="" priority_queue="" class,="" there="" is="" code="" that="" compares="" two="" of="" the="" objects="" in="" the="" priority_queue="" to="" see="" which="" one="" has="" the="" higher="" priority.="" if="" you="" try="" to="" use="" a="" priority_queue="" of="" events="" without="" providing="" an="" overloaded=""><(), you'll="" get="" a="" syntax="" error="" that="" says="" something="" like="" "no="">< operator="" is="" defined="" for="" objects="" of="" type="" event".="" so,="" you="" need="" to="" provide="" a="">< operator="" as="" a="" member="" function="" of="" the="" event="" class.="" (you="" could="" make="" it="" a="" friend="" function.="" i="" just="" made="" it="" a="" member="" function.)="" both="" of="" my="" classes="" have="" a="" data="" member="" "customerid",="" which="" is="" an="" int.="" your="" program="" should="" produce="" exactly="" the="" same="" output="" as="" given="" in="" the="" following="" example="" input="" and="" output:="" input="" file="" 1:="" in1.txt="" input="" file="" 2:="" in2.txt="" correct="" output="" for="" file="" 1:="" out1.txt="" correct="" output="" for="" file="" 2:="" out2.txt="" submit="" your="" work="" 2021/10/13="" 下午10:41="" cs="" 10c="" programming="" concepts="" and="" methodologies="" 2="" https://daveteaches.com/10c/a9.shtml="" 2/2="" use="" the="" assignment="" submission="" link="" to="" submit="" your="" solutions="" to="" assignment="" 9.1="" and="" your="" source="" code="" file="" from="" assignment="" 9.2.="" paste="" two="" sample="" outputs="" resulting="" from="" the="" two="" given="" input="" files="" at="" the="" bottom="" of="" your="" file,="" turning="" them="" into="" comments.="" when="" you="" submit="" your="" assignment="" there="" will="" be="" a="" text="" field="" on="" the="" canvas="" submission="" page="" in="" which="" you="" can="" add="" a="" note="" to="" me="" (called="" a="" "comment",="" but="" don't="" confuse="" it="" with="" a="" c++="" comment).="" in="" this="" "comments"="" section="" of="" the="" submission="" page="" let="" me="" know="" whether="" your="" program="" works="" as="" required.="" ©="" 1999="" -="" 2021="" dave="" harden="" 0132923831.pdf="" c++="" reserved="" keywords="" c++="" reserves="" and="" gives="" predefi="" ned="" meanings="" to="" the="" following="" keywords.="" you="" may="" not="" redefi="" ne="" key-="" words="" or="" use="" them="" for="" other="" purposes.="" keywords="" that="" appear="" in="" color="" are="" new="" since="" c++11.="" alignas="" decitype="" namespace="" struct="" alignof="" default="" new="" switch="" and="" delete="" noexcept="" template="" and_eq="" do="" not="" this="" asm="" double="" not_eq="" thread_local="" auto="" dynamic_cast="" nullptr="" throw="" bitand="" else="" operator="" true="" bitor="" enum="" or="" try="" bool="" explicit="" or_eq="" typedef="" break="" export="" private="" typeid="" case="" extern="" protected="" typename="" catch="" false="" public="" union="" char="" fl="" oat="" register="" unsigned="" char16_t="" for="" reinterpret_cast="" using="" char32_t="" friend="" return="" virtual="" class="" goto="" short="" void="" compl="" if="" signed="" volatile="" const="" inline="" sizeof="" wchar_t="" const_cast="" int="" static="" while="" constexpr="" long="" static_assert="" xor="" continue="" mutable="" static_cast="" xor_eq="" operator="" meaning="" associativity="" usage="" *="" multiply="" left="" expr="" *="" expr="" divide="" left="" expr="" expr="" %="" modulo="" left="" expr="" %="" expr="" +="" add="" left="" expr="" +="" expr="" -="" subtract="" left="" expr="" -="" expr="">< bitwise="" shift="" left‡="" left="" expr="">< expr="">> bitwise shift right‡ left expr >> expr< less="" than="" left="" expr="">< expr=""><= less="" than="" or="" equal="" to="" left="" expr=""><= expr=""> greater than left expr > expr >= greater than or equal to left expr >= expr == equal left expr == expr != not equal left expr != expr & bitwise AND left expr & expr ̂ bitwise EXCLUSIVE OR left expr ̂ expr | bitwise OR left expr | expr && logical AND left expr && expr || logical OR left expr || expr ? : conditional left expr ? expr : expr = assign left lvalue = expr *= multiply and assign left lvalue *= expr /= divide and assign left lvalue /= expr %= modulo and assign left lvalue %= expr += add and assign left lvalue += expr -= subtract and assign left lvalue -= expr<= shift="" left="" and="" assign="" left="" lvalue=""><= expr="">>= shift right and assign left lvalue >>= expr &= AND and assign left lvalue &= expr |= OR and assign left lvalue |= expr ̂ = EXCLUSIVE OR and assign left lvalue ̂ = expr , comma left expr , expr ‡ Typically overloaded for I/O Data Abstraction & Problem Solving with C++ WALLS AND MIRRORS SIXTH EDITION Frank M. Carrano University of Rhode Island Timothy Henry University of Rhode Island ISBN 10: 0-13-292372-6 ISBN 13: 978-0-13-292372-9 Credits and acknowledgments borrowed from other sources and reproduced, with permission, in this textbook appear on the appropriate page within text. Copyright © 2013, 2007, 2005 Pearson Education, Inc., publishing as Addison-Wesley. All rights reserved. Printed in the United States of America. This publication is protected by Copyright, and permission should be obtained from the publisher prior to any prohibited reproduction, storage in a retrieval system, or transmission in any form or by any means, electronic, mechanical, photocopying, recording, or likewise. To obtain permission(s) to use material from this work, please submit a written request to Pearson Education, Inc., Permissions Department, One Lake Street, Upper Saddle River, New Jersey 07458
Answered 23 days AfterOct 18, 2021

Answer To: CS 10C Programming Concepts and Methodologies 2 2021/10/13 下午10:41 CS 10C Programming Concepts and...

Kamal answered on Oct 19 2021
119 Votes
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here