讲解:CISC 220、C/C++、CASLab Linux、C/C++Matlab|Python

Assignment 5CISC 220, Fall 2018Administrative Notes:All of the administrative notes from previous assignments apply to this assignment as well. I willjust summarize the main points here and you can refer back to the previous assignmentsinstructions for more details: Your program should work in CASLab Linux servers. No group work allowed. Hand in your file to OnQ in the “Assignment 5” Dropbox area. Follow instructions carefully or you may lose points. There is a 24-hour “grace period” after the official deadline for each assignment;submissions made within this period lose 10% but are still accepted.Deadline:The deadline for this assignment is Monday, November 19 at 8 a.m. The grace period lastsuntil Tuesday, November 20, 2018 at 8 a.m.Required Program:This is your structures assignment and your task is to write a fairly simple C program. It can bedone with the features of C weve discussed in the “Structures” topic. The program requires tocreate a stack structure using linked lists. The size of the stack is only 3 units. You are going topush 4 elements into the stack, and pop also 4 elements. You may use what we have covered andexplained in the class.The object of your program is to demonstrate the skills you have learned in C programming.Your program will work as follows when it is executed:1- It will create a stack structure using struct, typdef, and linked list. Your program must usethese data structure to build and use the stack.2- You will push 3 strings into the stack successfully, and get an error when you push thefourth.3- You will pop the 3 strings from the stack successfully, and get an error when you try topop the fourth from an empty stack.4- Pushing and popping functions are run by the program in order, pushing first thenpopping. Pushing function should use the following set of strings{ “Fist Element” , “Second Element” , “Third Element” , “Fourth Element” }. Theprogram should print the status of the stack after each push including the error when thefourth string is pushed.5- Popping function will pop all elements of the stack plus one more pope when the stack isempty. The program should priCISC 220作业代做、代写C/C++课程设计作业、代做CASLab Linux作业、代写C/C++实验作业 调试Mant the status of the stack after each pop including the errorwhen you try to pop an empty stack.6- Your program should use “malloc” to reserve memory units to be used by the stack, andthe allocated memory should be deallocated by using free() function.7- QuitFor example: When you run the program, it should produce the following output:Creating a Stack that can take only 3 string elements.PushingThe stack status: { “First Element” }PushingThe stack status : { “First Element” , “Second Element” }PushingThe stack status: { “First Element” , “Second Element” , “ Third Element” }PushingThe stack is full and cannot take any more elements.PoppingThe stack status: { “First Element” , “Second Element” }PoppingThe stack status: { “First Element” }PoppingThe stack is emptyPoppingCannot pop an empty stackEnd of programYou have to use:1- Struct, typedef, and linked lists.2- Push function.3- Pop function4- Control memory with malloc and free functions5- The output should be identical to the given one.Your assignment worth 20 points.More Requirements:? Your program must be in a single file called CISC220-Assn5.XXXX.cthe XXXX represent your last four digits of your students ID.Marking Scheme: Use of struct : 2 Use of typedef: 2 Use of linked list: 2 Controlling memory with malloc and free functions: 2 Correctness of the program. Does it have push and pop functions? Does the main partworks correctly: 8 Formatting of the output, does it match the given format: 2 Clear and organized Coding style: 2Total: 20If you do not follow the assignment requirements -- especially if you deviate from them in a waythat costs us time while marking -- you will lose administrative points even if your programworks correctly. So please read the directions carefully.Possible Penalties:10% if you hand in during the late period (24 hours after the deadline).10-20% if there are administrative issues that cause the graders extra time.Style:Use tabs and proper indentation to organize your program. Use common naming conventions wehave been using in our examples at classes.转自:http://ass.3daixie.com/2018112013362303.html

你可能感兴趣的:(讲解:CISC 220、C/C++、CASLab Linux、C/C++Matlab|Python)