美文网首页
代做CS 211留学生作业、代写C++程序语言作业、代做Prog

代做CS 211留学生作业、代写C++程序语言作业、代做Prog

作者: tupimei | 来源:发表于2019-03-20 18:19 被阅读0次

CS 211 – Programming Practicum Spring 2019Programming Project 4Due: Sunday, 3/17/19 at 11:59 pmFast Food Order ManagementFor this project, write a C program that will implement a food ordering system used in a fastfood restaurant. This restaurant only serves burgers and salads and when people want to orderfood, they give their name and food choices to the cashier and then wait until those in front ofthem have been served. The program must use a linked list to implement the queue-like datastructure.The linked list is to maintain the following information for each group that is waiting: name (we assume a maximum name length of 30 characters) food items (number of burgers and salads ordered) in-restaurant status: whether the group has called ahead or is waiting in the restaurantThe system allows you to call and put your order in before you arrive at the restaurant, but itdoes not take orders for a specific time and date (i.e. 4 burgers and 2 salads for 7pm onSaturday). Note: these call-ahead groups will still need to check in when they arrive, so thecashier knows they are waiting in the restaurant.Groups are added to the order list when they call-ahead or when they arrive at the restaurant.Groups are always added to the end of the order list. The system will require that each nameused be unique. So when a group is added to the order list, the system must make sure that noother group is already using that name.The restaurant staff working in the kitchen have a steady speed in preparing food and they workon one order at a time. On average, preparing a salad takes 5 minutes while burger takes 10minutes.The system needs to track how many food items have been ordered and provide customers withan estimated wait time.You can assume that every time an order is being called, it will go to the first group in line.However, in order to pick up the food, the group needs to be present at the restaurant. If they arenot, then the system will call the next eligible group for pick up (an eligible group is a group thatthe number of burgers and salads they ordered is less than or equal to prepared order).The commands used by this system are listed below and are to come from standard input. Yourprogram is to prompt the user for input and display error messages for unknown commands orimproperly formatted commands. Note that the name of the group when given will be given asthe last item on the input line. The name of the group may contain white space characters in themiddle of the name but not at the beginning or end of the name. Each command given mustdisplay some information about the command being performed. Code to implement thisinterface is provided in the program proj4base.c.CS 211 – Programming Practicum Spring 2019Command Descriptionq Quit the program. List the commands used by this program and a brief description of howto use each one.a Add the order to the order list using the given order and namespecifying the group is waiting in the restaurant. The order’sinformation is added to the end of the list. If the name already exists inthe order list, give an error message and do not add the information.c Add the order to the order list using the given order and namespecifying the order as a call ahead order. The order’s information isadded to the end of the list. If the name already exists in the order list,give an error message and do not add the information.w Mark the call ahead order using the given name as waiting in therestaurant. If the name does not exist is the order list or is not a callahead group, give an error message.r Retrieve and remove the first order on the order list that is waiting inthe restaurant and contains less than or equal to number of preparedburgers and salads. Note that “first” is the order that has been in theorder list the longest.l List total number of orders that are in the order list in front of the orderspecified by the given name. If the name does not exist, give an errormessage.t Give an estimated waiting time based on the order list knowingpreparing burgers will take 10 minutes and preparing salads takes 5.If the name does not exist, give an error message.d Display the total number of orders in the order list. Also display thenames, order details and in-restaurant status of all orders in the orderlist in order from first to last.Note that and are to be integer values and is a list of characters.The symbols are NOT part of the input but being used to describe the input.Use of C struct and C functionsWhen writing your code, you MUST create a C struct for the nodes in the linked list of the orderlist. These data items must include the following (and may include others if desired): the name of the order the integer variables specifying details of the order (number of burgers and salads) the in-restaurant status (you should use an enum!) a pointer to the next node in the listThe pointer for the head of the linked list MUST be declared as a local variable in main() orsome other function. It may NOT be global. If you wish to have the head of the list enclosed ina structure with some other information, that is OK (but certainly not required). The variableused to access this structure; however, may not be global. Each operation performed on thelinked list MUST be done in its own function. These functions must take the head of the linkedlist as the FIRST parameter.CS 211 – Programming Practicum Spring 2019Linked List Operations/FunctionsYou must write C functions for the following 8 operations. These functions must be called whenthe specified commands are given as input.addToList ( ) – This operation is to add a new node to the end of the linked list. This is to beused when the a and c commands are given as input.doesNameExist ( ) – This operation is to return a Boolean value indicating whether a namealready exists in the linked list. This is to be used when the a, c, w, t and l commands are givenas input.updateStatus ( ) – This operation is to change the in-restaurant status when a call-ahead orderarrives at the restaurant. This operation will return a FALSE value if that order is alreadymarked as being in the restaurant. This is to be used when the w command is given as input.retrieveAndRemove ( ) – This operation is to find the first in-restaurant order that matches theorder prepared for pick up at the counter. This operation is to return the name of group. Thisgroup is to be removed from the linked list. This is to be used when the r command is given asinput.countOrdersAhead ( ) – This operation is to return the number of orders waiting ahead of anorder with a specific name. This is to be used when the l command is given as input.displayWaitingTime( ) – This operation is to return the estimated waiting time for the specificname. The function will check the number of burgers and salads ordered ahead of the specifiedname and using known preparing time (10 minutes for burger and 5 minutes for salad) calculatesthe estimated wait time. This is to be used when t command is given as input.displayOrdersAhead ( ) – This operation traverses down the list until a specific order name isencountered. As each node is traversed, print out that node’s orders. This command is to beused when the l command is given.displayListInformation ( ) – This operation to traverse down the entire list from beginning toend. As each node is traversed, print out that node’s name, order details and in-restaurant status.This command is to be used when the d command is given as input.Note that there may be a many-to-many relationship between the commands in the user interfaceand the required functions. For example, the l command (“list”) relies on the followingfunctions: doesNameExist(), countOrdersAhead() and displayOrdersAhead().Command Line Argument: Debug ModeYour program is to be able to take one optional command line argument, the -d flag. When thisflag is given, your program is to run in debug mode. When in this mode, your program is todisplay each order’s information as you traverse through the linked list of the order list. Notethat for the w, r, t and l commands, the entire list may not be traversed, so you only display thepart of the list that is needed to be traversed to complete the command.CS 211 – Programming Practicum Spring 2019When the flag is not given, this debugging information should not be displayed. One simple wayto set up a debugging mode is to use a boolean variable which is set to true when debuggingmode is turned on but false otherwise. This variable may be a global variable. Then using asimple if statement controls whether information should be output or not.if ( debugMode == TRUE )printf ( Debugging Information );Provided Code for the User IntefaceThe code given in proj4base.c should properly provide for the user interface for this programincluding all command error checking. This program has no code for the linked list. It is yourjob to write the functions for the specified operations and make the appropriate calls. Most ofthe changes to the existing proj4base.c program need to be made in each of the doXXXX ( )functions. Look for the comments of:// add code to perform this operation hereNote: the head of the linked list is required to be a local variable in main and you are required topass the head of the linked to the operation functions. All of the doXXXX ( ) functions currentlyhave no parameters. It will then be expected that you will modify the function signatures of thedoXXXX() functions to allow for this information to be passed as required.MULTIPLE SOURCE CODE FILESYour program is to be written using at least three source code files. It must also have a makefileand a header file to help with the compilation of the program. All of the storage structure code(the linked list code) is to be in one source code file. The code in proj4base.c is to be separatedinto two different source code files.The following functions from proj4base.c are to be in one source code file (these are the userinterface functions): main() clearToEoln() getNextNWSChar() getPosInt() getName() printCommands()The following functions from proj4base.c are to be in another source code file (these are thefunctions that interact with the linked list functions): doAdd() doCallAhead() doWaiting() doRetrieve() doList() doDisplay() doEstimateTime()CS 211 – Programming Practicum Spring 2019The third source code file is to have the code that you are writing that will perform the linked listimplementation: The functions in this source code file will include the following functions plusany other you write to handle the linked list: addToList() doesNameExist() updateStatus() retrieveAndRemove() countOrdersAhead() displayOrdersAhead() displayListInformation() displayWaitingTime()If you add additional functions to your program, you can add those to whichever source code fileseems appropriate for that function (or create a fourth source code file or even a fifth).You must also create a header file. The job of the header file is to contain the information so thesource code files can talk to each other. The header file (.h file) should contain the functionprototypes and any struct and/or typedef statements. Please review the .h file in the examplebelow.The makefile MUST separately compile each source code file into a .o file and separately linkthe .o files together into an executable file. Review the makefile in the example below to seehow this is done. The command to create the .o file is:gcc –c program1.cThe command to link the files program1.o, program2.o and program3.o into an executable file is:gcc program1.o program2.o program3.oThe above command will just name the executable file using the default name of a.out, mostoften the –o option is given to provide a specific name for the executable file.gcc program1.o program2.o program3.o –o program.exeExample of Multiple Source Code FilesConsider the program contained in the following files: max1.c max2.cmakefileThis example shows how to set up this simplest of multiple source code file program. Note thatmax1.c and max2.c just contain functions and a #include of max.h. The file max.h contains theprototypes (or forward declarations) for all of the functions that are called from outside its sourcecode file and any globally needed information.The makefile is a special file that helps in the compilation of the source code into the object filesinto the executable file. A makefile is executed by the use of the make command. The syntax ofa makefile can be strange. The makefile will contain multiple rules. Each rule has the followingsyntax:target: dependencyListcommandLineCS 211 – Programming Practicum Spring 2019The multiple rules in the make file are separated by a blank line. Also note (this is VERYIMPORTANT) the commandLine must use a TAB for its indentation! An example of a rule is:max1.o: max1.c max.hgcc -c max1.cThe commandLine is gcc -c max1.c, which will compile the source code file of max1.c into theobject code file of max1.o.The target in the above example is the file max1.o, which is also the name of the file createdwhen the commandLine is executed. This relationship is what causes makefiles to work.The dependencyList in the above example is the two files: max1.c and max.h, which are thefiles needed for the commandLine to properly run. Again, this relationship is what causesmakefiles to work.The make command uses the timestamps of the files in the target and the dependencyList. If anyfile in the dependencyList has a more recent timestamp than the target file, the commandLine isexecuted. The idea is that if the user has recently changed either max1.c or max.h, then theobject file max1.o needs to be re-compiled. Make is designed to help the programmer keep trackof what needs to be compiled next.Make and makefile tutorials can be found at: http://mrbook.org/tutorials/make/ http://www.gnu.org/software/make/manual/make.html http://www.opussoftware.com/tutorial/TutMakefile.htmCoding StyleDon’t forget to use good coding style when writing your program. Good coding style makesyour program easier to be read by other people as the compiler ignores these parts/differences inyour code. Elements of good code style include (but may not be limited to): Meaningful variable names Use of functions/methods Proper indentation Use of blank lines between code sections In-line comments Function/method header comments File header commentsThe Code Review Checklist also hints at other elements of good coding style.CS 211 – Programming Practicum Spring 2019Program SubmissionYou must zip all of your files needed for the program together and then submit the zip file forthis lab via the Assignments Page in Blackboard.To help the TA, create a directory with your net-id and the assignment name, such as: netidProject4Then put the 3 source code files, your header file and your makefile into this directory. Zip thisdirectory and submit the zip file.本团队核心人员组成主要包括硅谷工程师、BAT一线工程师,精通德英语!我们主要业务范围是代做编程大作业、课程设计等等。我们的方向领域:window编程 数值算法 AI人工智能 金融统计 计量分析 大数据 网络编程 WEB编程 通讯编程 游戏编程多媒体linux 外挂编程 程序API图像处理 嵌入式/单片机 数据库编程 控制台 进程与线程 网络安全 汇编语言 硬件编程 软件设计 工程标准规等。其中代写编程、代写程序、代写留学生程序作业语言或工具包括但不限于以下范围:C/C++/C#代写Java代写IT代写Python代写辅导编程作业Matlab代写Haskell代写Processing代写Linux环境搭建Rust代写Data Structure Assginment 数据结构代写MIPS代写Machine Learning 作业 代写Oracle/SQL/PostgreSQL/Pig 数据库代写/代做/辅导Web开发、网站开发、网站作业ASP.NET网站开发Finance Insurace Statistics统计、回归、迭代Prolog代写Computer Computational method代做因为专业,所以值得信赖。如有需要,请加QQ:99515681 或邮箱:99515681@qq.com 微信:codehelp

相关文章

网友评论

      本文标题:代做CS 211留学生作业、代写C++程序语言作业、代做Prog

      本文链接:https://www.haomeiwen.com/subject/qjbtvqtx.html