久久久久久精品无码人妻_青春草无码精品视频在线观_无码精品国产VA在线观看_国产色无码专区在线观看

COMP2017代寫、c/c++編程語言代做

時間:2024-03-30  來源:  作者: 我要糾錯



COMP2017 9017 Assignment 2
Due: 23:59 28 March 2024
This assignment is worth 10% of your final assessment
Task Description
Your task is to create a multi-type linked list data structure and a program that interacts with it. Your
assignment is broken into three tasks that must be completed in order.
• The first part is the basic command syntax of the linked lists, creation, removal, viewing etc.
• The second part is modifying the lists in place, through insertion and deletion of elements.
• The third part is allowing lists to refer to each other in a nested pattern.
It is also recommended to read through the specification carefully. You should ensure that you create
test cases that cover a range of possible inputs before beginning to code.
1 Make sure you identify and
test for edge cases.
Implementation Details
All commands are read through standard in, and all output is given through standard out.
Part 1: Basic Commands
For Part 1, your linked lists must support elements of the following types:
• int
• float
• char
• string
Your program should take in commands from stdin that will create and manage these multi-type
linked lists. The basic commands are:
1Even if you do it on pencil and paper, work through some examples to be sure you understand.
1
COMP2017 9017
• NEW <number of elements> - create a new list
• VIEW <list index> - view a specific list by its index
• TYPE <list index> - view a specific list by its index, printing out the types of each element.
• VIEW ALL - print the number of lists and each list in order of creation
• REMOVE <list index> - remove a list
The index for each list should be 1 higher than the last created list’s index, starting from 0 for the first
list, regardless of how many lists have been removed.
Basic Examples
In the following examples, "> " denotes the following line as input. Your program must not print it to
stdout or read it from stdin. It is included in the formatting only as an indicator, to differentiate
the input from the output of the program.
Command keywords are delimited by exactly one (1) space character and should have no leading
and trailing whitespaces2
. Be sure to replicate the formatting of these examples exactly, character by
character.
The NEW Command
This command takes in a number as input for the initial size of the list. It then reads in an initial value
for each element to initialise the list. 0 is a valid size, negative numbers are not. Lists are labelled
starting at 0 when they begin to exist, and the label always increments, even if a list is removed.
Imagine in the following section that 4 lists have already been created.
> NEW 5
> hello
> 1
> 2
> 3.14
> a
List 4: hello -> 1 -> 2 -> 3.14 -> a
Lists will only be considered as "created" after all lines of the input have been parsed and no error
occurs.
The VIEW Command
This command prints out the contents of the list at the given index.
2
except when INSERT ing a string. See below examples
Systems Programming Page 2 of 15
COMP2017 9017
> VIEW 4
hello -> 1 -> 2 -> 3.14 -> a
The TYPE Command
This command prints out the types of each element at the given list.
> TYPE 4
string -> int -> int -> float -> char
The VIEW ALL Command
This command prints out the current set of lists in index-increasing order.
> VIEW ALL
Number of lists: 3
List 0
List 3
List 4
The REMOVE Command
This command deletes a list, and prints out the current set of lists again in index-increasing order.
> REMOVE 3
List 3 has been removed.
Number of lists: 2
List 0
List 4
Invalid Commands
A command can be identified from a line if the line strictly begins with exactly the command keyword,
and is invalid if its invalid otherwise.
If a command is invalid in some way, print INVALID COMMAND: <command used>. For example, when there is no List 4:
> REMOVE 4
INVALID COMMAND: REMOVE
Systems Programming Page 3 of 15
COMP2017 9017
If a command cannot be identified, use INPUT. For example:
> abracadabra
INVALID COMMAND: INPUT
It is up to you to find and prepare for edge cases.
Type Rules and Exceptions
There can be some ambiguity in certain cases for what a given input’s type is. The order for type
checking is as follows:
• integer
• float
• char
• string
Requirements for types are as follows:
• int can be negative, positive or zero (tests will also not exceed the maximum and minimum
value for an int type).
• float is the same except it will always have a decimal point.3
• float should also be printed to 2 decimal places, though they can be read in to any precision.
• char is any printable4
character in ascii as long as it is singular.
• string covers all other cases.
• Empty lines in list creation should be considered as string.
• string can start with leading and trailing whitespace characters.
• Lines containing one int or float can have leading and trailing whitespaces. These will be
interpreted as numbers. (Note that this is the default behaviour of scanf).
• All inputs will have a maximum total line length of 128 bytes.
> NEW 4
> 1.0
>
> baguette
> 5
List 4: 1.00 -> -> baguette -> 5
3The exception being scientific notation which should also be accepted, i.e. 2e-4 = 0.0002. Note that
scanf accepts this type of input by default.
4isprint() returns true
Systems Programming Page 4 of 15
COMP2017 9017
Note the empty line that was interpreted as an empty string, as well as the extra space in " baguette".
There will be no test cases that do not fit this description.
Note: Curly brackets {} are used in Part 3, and are considered invalid input if they appear in any form
other than specified there. 5
> NEW 3
> 1.0
> {}
> baguette
INVALID COMMAND: NEW
> NEW 3
> 1.0
> {
> wordswords } words
INVALID COMMAND: NEW
Exiting the program
Upon EOF, the program should free all used dynamic memory, then exit.
Part 2: Dynamic Lists
In this part you are to implement two extra commands: INSERT and DELETE.
The INSERT Command
This command takes input of the form INSERT <list id> <index> <value>, and inserts
the value at the given index of the given list. It should then print out the new list in the same format
as VIEW, but with the string "List <n>: " before it. For example:
> VIEW 1
a -> b -> c -> d
> INSERT 1 0 Baguettes
List 1: Baguettes -> a -> b -> c -> d
Negative indices should insert from the end of the list. Indices outside the range are invalid:
> VIEW 1
a -> b -> c -> d
> INSERT 1 -1 Baguettes
List 1: a -> b -> c -> d -> Baguettes
5For completion of Parts 1 and 2, it is sufficient to raise an error whenever curly brackets are detected. Part
3 introduces a single exceptional use which is not an error.
Systems Programming Page 5 of 15
COMP2017 9017
> INSERT 1 97 Croissants
INVALID COMMAND: INSERT
The DELETE COMMAND
This command takes input of the form DELETE <list id> <index> and removes the given
index from the list. It should then print out the new list in the same format as INSERT. The same
conditions on indices apply. For example:
> VIEW 1
a -> b -> c -> d
> DELETE 1 0
List 1: b -> c -> d
> DELETE 1 -1
List 1: b -> c
> DELETE 1 4
INVALID COMMAND: DELETE
Part 3: Nested Lists
For this section, you are to modify your previous code to accept a new type: other lists. This is to a
maximum depth of one. This means every list is either a simple list (contains only regular types), or
a nested list (contains regular types and simple lists). Nested lists cannot contain other nested lists.
Nested lists contain only references to simple list(s). Thus, changes to the simple list should also be
reflected in the nested list.
To insert a simple list into a nested list, it should be specified with curly brackets. When nested lists
are printed, they should be labelled as Nested, like so:
> VIEW 1
a -> b -> c -> d
> NEW 3
> first
> {1}
> last
Nested 2: first -> {List 1} -> last
> VIEW ALL
Number of lists: 2
List 1
Nested 2
Any command that refers to a non-existent list, or would result in any list having depth greater than 1
should give an INVALID COMMAND:
Systems Programming Page 6 of 15
COMP2017 9017
> VIEW 0
a -> b -> c -> d
> NEW 2
> first
> last
List 1: first -> last
> INSERT 1 1 {0}
Nested 1: first -> {List 0} -> last
> NEW 1
> {1}
INVALID COMMAND: NEW
If all references are deleted from a nested list with DELETE, then it becomes a simple list. The TYPE
command should print reference as the type of any references to other lists.
> VIEW 0
a -> b -> c -> d
> VIEW 1
first -> {List 0} -> last
> TYPE 1
string -> reference -> string
Removal of a simple list while it is referenced by any other list should give an
INVALID COMMAND: REMOVE.
The VIEW-NESTED Command
This command can print any list, but when it prints a nested list, it will also print its sub-lists, contained
in curly brackets. Like so:
> VIEW 1
a -> b -> c -> d
> VIEW 2
first -> {List 1} -> last
> VIEW-NESTED 1
a -> b -> c -> d
> VIEW-NESTED 2
first -> {a -> b -> c -> d} -> last
Restrictions
To successfully complete this assignment you must:
• Use dynamic memory.
Systems Programming Page 7 of 15
COMP2017 9017
• Use linked list structures,6
they must be your own implementation.7
• Free all dynamic memory that is used.
• NOT use any external libraries, other than those in glibc.
• Other restricted functions may come at a later date.
Any submission breaking these restrictions will receive a deduction of up to 5 marks per breach.
All texts within your submission that may be read by a reviewer (marker), including code comments,
git commit messages, README files, and so on, should be written in English. Any readable text that
is not written in English will receive a deduction of 1 mark per line.
Working on Your Assignment
You are encouraged to submit your assignment on Ed while you are in the process of completing it.
By submitting you will obtain some feedback of your progress on the sample test cases provided.
If you have any questions about C functions, then refer to the corresponding man pages. You can and
should ask questions about this assignment on Ed. As with any assignment, make sure that your work
is your own, and that you do not share your code or solutions with other students.
Getting Started
The most important factor for success is your choice of data structures. We recommend:
1. Read the specification and write test cases.
2. Design your data structures.
3. Part 1 Commands
4. Part 2 Commands
5. Part 3 Commands
Writing even a few simple test cases of your own will ensure you understand the details of what
you’ve been asked to do. Even on pen and paper, this is incredibly beneficial.
Data structure design will have the largest impact on the quality of your code (both in terms of style
and correctness). The scaffold has a few suggestions on the function prototypes you should use, but
does not cover every instance. Be considerate of how your linked-list will function.
6There are no requirements on what kind of data structure is used to keep track of all the created lists, as
long as it is dynamic and the lists themselves are linked lists of any kind.
7This means you mustn’t cite or borrow code from any other source. Design and implement the structure
yourself.
Systems Programming Page 8 of 15
COMP2017 9017
Debugging and Avoiding Leaks
It is recommended that you use tools such as gdb, valgrind and ASAN
(the -fsanitize=address,leaks compilation flags).
These will assist in finding basic errors (gdb) and monitoring memory leaks (valgrind, ASAN).
However, they cannot automatically prevent memory errors and leaks. You should be conscious of
where leaks may occur and verify them yourself.8
Note: Mac users may need to use a full virtual machine (VM) to make use of these tools. We have had
reports of both valgrind and ASAN being unusable on Macs. Please refer to Ed for more details.
Compilation and Testing
Your program should be compiled by the default rule, which is the first defined rule of the Makefile.
You should name this make rule build. After compilation, your program should be a single binary
file called mtll which is used to run your program.
# compile the program
make
# alternatively
# make build
# run the program
./mtll
You should implement your program in multiple C source and header files. This is required for full
style marks.9 They must all compile together into one single binary when the program is built.
You should also do your own testing. If you need to compile/create your tests before running them,
please implement a make rule called tests for this and then a separate one for running your tests.
Please also store your tests in the tests directory provided.
After the assignment is released, a small number of test files will be made available. Correctness tests
will be provided to ensure that your code can execute fundamental examples. These tests will not be
the complete set of tests run against your code.
Any attempt to deceive the marking system (such as hard coding test cases) will receive a zero.
# compile the tests if necessary
make tests
# run the tests
make run_tests
8This is helped by having a plan for what data structures you will use, and how your code will manage them.
9
It is recommended to break up your code into suitable sections, i.e. the main source file handles input, a
separate source file for list management functions, etc.
Systems Programming Page 9 of 15
COMP2017 9017
Submission
Submissions for this assignment will be through git.
The general process of writing and submitting is the same:
git add <files>
git commit -m "fix memory leak in function x"
git push
If you have any questions about git usage, feel free to check the Git Lesson, the relevant manual
pages, or ask on Ed.
Do NOT push binaries, including executables and object files. Either add your source files manually,
or create a .gitignore file that includes the names of all your binaries.
None of your git commits should contain a binary file. Any submission breaking this restriction will
receive a deduction of 1 mark per commit.
Marking Details
The assignment is worth 10% of your final grade. This is marked out of 20, and breaks down as
follows:
Marks Item Notes
3/20 Code Style Manual marking
2/20 Test Case Coverage Manual marking
6/20 Part 1 Correctness Automatic tests
6/20 Part 2 Correctness Automatic tests
3/20 Part 3 Correctness Automatic tests
For style, refer to the style guide on ed: https://edstem.org/au/courses/14786/lessons/
49533/slides/334765. You will also be marked based on the modularity and organisation of
your code. For full marks, code should be organised in multiple source files, and use modular, taskspecific functions. Organised data structures are essential here.
The scaffold provides some suggestions on what this looks like, but more will be necessary.
For test case coverage: This first mark is for coverage of basic command syntax. Full marks will be
awarded for consideration of at least 3 edge cases. These may be for sections of the assignment you
have not completed.10
The below table gives an indication of what is expected. Note this is not a set marking scheme, more
a guideline. Refer to the above table for clearer ideas.
10Feel free to look for edge cases in Part 3 even if you do not manage to code it.
Systems Programming Page 10 of 15
COMP2017 9017
Expected Award Level of Completion
Pass Good code style, good test coverage and completion of Part 1.
(Style misses one or two things: not modular, not multiple source files, etc.)
Credit Excellent style and tests, most of Part 2.
Good style and tests, completion of Part 2.
Distinction Excellent style and tests, completion of Part 2
High Distinction Excellent style and tests, completion of Part 3
Further Examples
All Basic Commands:
> NEW 3
> hello
> 2
> 1
List 0: hello -> 2 -> 1
> NEW 3
> 3.14
> world
> a
List 1: 3.14 -> world -> a
> VIEW ALL
Number of lists: 2
List 0
List 1
> VIEW 1
3.14 -> world -> a
> REMOVE 0
List 0 has been removed.
Number of lists: 1
List 1
> NEW 3
foo
bar
5
List 2: foo -> bar -> 5
> VIEW ALL
Number of lists: 2
List 1
List 2
Systems Programming Page 11 of 15
COMP2017 9017
Insert and Delete Commands:
> NEW 3
> hello
> 6
> 2e-2
List 0: hello -> 6 -> 0.02
> DELETE 0 2
List 0: hello -> 6
> INSERT 0 -2 goodbye
List 0: hello -> goodbye -> 6
> DELETE 0 -1
List 0: hello -> goodbye
> DELETE 0 -1
List 0: hello
> DELETE 0 -1
List 0:
> REMOVE 0
List 0 has been removed.
Number of lists: 0
Note the leading space in ’ goodbye’.
Nested Lists
> NEW 3
> this
> is
> simple
List 0: this -> is -> simple
> NEW 4
> this
> is-nested
> {0}
> 4.0 h
Nested 1: this -> is-nested -> {List 0} -> 4.0 h
> VIEW-NESTED 1
this -> is-nested -> {this -> is -> simple} -> 4.0 h
> NEW 1
> other
List 2: other
> INSERT 0 2 {2}
INVALID COMMAND: INSERT
> REMOVE 0
Systems Programming Page 12 of 15
COMP2017 9017
INVALID COMMAND: REMOVE
> DELETE 1 2
List 1: this -> is-nested -> 4.0 h
> INSERT 0 2 {1}
Nested 0: this -> is -> {List 1} -> simple
> INSERT 0 0 {1}
Nested 0: {List 1} -> this -> is -> {List 1} -> simple
> DELETE 0 0
Nested 0: this -> is -> {List 1} -> simple
> VIEW-NESTED 0
this -> is -> {this -> is-nested -> 4.0 h} -> simple
Note "4.0 h" is a string, not a float.
Systems Programming Page 13 of 15
COMP2017 9017
Academic Declaration
By submitting this assignment you declare the following: I declare that I have read and understood
the University of Sydney Student Plagiarism: Coursework Policy and Procedure, and except where
specifically acknowledged, the work contained in this assignment/project is my own work, and has
not been copied from other sources or been previously submitted for award or assessment.
I understand that failure to comply with the Student Plagiarism: Coursework Policy and Procedure
can lead to severe penalties as outlined under Chapter 8 of the University of Sydney By-Law 1999 (as
amended). These penalties may be imposed in cases where any significant portion of my submitted
work has been copied without proper acknowledgment from other sources, including published works,
the Internet, existing programs, the work of other students, or work previously submitted for other
awards or assessments.
I realise that I may be asked to identify those portions of the work contributed by me and required to
demonstrate my knowledge of the relevant material by answering oral questions or by undertaking
supplementary work, either written or in the laboratory, in order to arrive at the final assessment
mark.
I acknowledge that the School of Computer Science, in assessing this assignment, may reproduce
it entirely, may provide a copy to another member of faculty, and/or communicate a copy of this
assignment to a plagiarism checking service or in-house computer program, and that a copy of the
assignment may be maintained by the service or the School of Computer Science for the purpose of
future plagiarism checking.
Systems Programming Page 14 of 15
COMP2017 9017
Changes
Any changes made to this document will be updated here.
19/03/2024-23:00 - New restriction and deduction rules will apply to non-English readable texts.
18/03/2024-20:45 - Made NEW, VIEW, and TYPE examples share the same context. Clarify list creation time, clarify invalid input conditions, added nested list insert example
17/03/2024-19:47 - Update INSERT and DELETE outputs. Resolve Further example - Nested lists
typo
16/03/2024-19:36 - Update invalid command criteria, update testing instructions, resolved typos in
examples, made the VIEW, VIEW_NESTED command consistent, updated restrictions, reformatted
Changes page.
15/03/2024-22:30 - resolve typos in description, test cases made consistent with spec, clarifications
made in part 1 (various)
15/03/2024-15:47 - resolve typos in Part 1 (The TYPE command, requirements for types), Part 3
snippet 2
Systems Programming Page 15 of 15

請加QQ:99515681  郵箱:99515681@qq.com   WX:codehelp 

標簽:

掃一掃在手機打開當前頁
  • 上一篇:INFO-5060代做、代寫C++程序語言
  • 下一篇:代做CS112編程、代寫Poker設計程序
  • 無相關信息
    昆明生活資訊

    昆明圖文信息
    蝴蝶泉(4A)-大理旅游
    蝴蝶泉(4A)-大理旅游
    油炸竹蟲
    油炸竹蟲
    酸筍煮魚(雞)
    酸筍煮魚(雞)
    竹筒飯
    竹筒飯
    香茅草烤魚
    香茅草烤魚
    檸檬烤魚
    檸檬烤魚
    昆明西山國家級風景名勝區
    昆明西山國家級風景名勝區
    昆明旅游索道攻略
    昆明旅游索道攻略
  • 短信驗證碼平臺 理財 WPS下載

    關于我們 | 打賞支持 | 廣告服務 | 聯系我們 | 網站地圖 | 免責聲明 | 幫助中心 | 友情鏈接 |

    Copyright © 2025 kmw.cc Inc. All Rights Reserved. 昆明網 版權所有
    ICP備06013414號-3 公安備 42010502001045

    久久久久久精品无码人妻_青春草无码精品视频在线观_无码精品国产VA在线观看_国产色无码专区在线观看

    少妇一级淫免费放| 真实国产乱子伦对白视频| 色一情一区二区| 国产a级一级片| 免费一级淫片aaa片毛片a级| 九九热免费在线观看| 国产综合免费视频| 一区二区传媒有限公司| 青青在线免费观看| 日韩人妻一区二区三区蜜桃视频| 天堂一区在线观看| 成人小视频在线看| 国产l精品国产亚洲区久久| 精品视频在线观看一区二区| 欧美专区第二页| 免费精品99久久国产综合精品应用| 777久久久精品一区二区三区| 日韩人妻无码精品久久久不卡| 一本色道久久88亚洲精品综合| 中文字幕 欧美日韩| 老司机久久精品| 99sesese| www.污网站| 日本中文字幕精品—区二区| 一级性生活视频| 免费精品99久久国产综合精品应用| 天堂在线资源视频| 成人免费毛片播放| 在线视频日韩一区| 日日干夜夜操s8| 日韩不卡一二三| 嫩草视频免费在线观看| 四虎1515hh.com| 51xx午夜影福利| 日韩av中文字幕第一页| 国产精品又粗又长| 久久久久久久久久久视频| 黄色片一级视频| av污在线观看| 色婷婷激情视频| 久久男人资源站| 内射国产内射夫妻免费频道| 狠狠爱免费视频| 污网站在线免费| 男女爱爱视频网站| 成人免费观看cn| caopor在线视频| 日韩欧美理论片| 日韩成人手机在线| 日本三级免费观看| 污色网站在线观看| 一道本在线观看视频| 欧美午夜性视频| 中文字幕第80页| 一级黄色免费在线观看| 久艹视频在线免费观看| 亚洲视频在线观看一区二区三区| 日韩在线一区视频| 草草视频在线免费观看| 国产精品无码av无码| 黄色一级片免费播放| 蜜桃传媒一区二区三区| 亚洲少妇久久久| 女人色极品影院| 538在线视频观看| 大桥未久一区二区三区| 久久美女福利视频| 激情久久综合网| 国产二区视频在线播放| 99精品999| 国产精品免费入口| 做爰高潮hd色即是空| 99精品人妻少妇一区二区 | 91 在线视频观看| 免费高清一区二区三区| www.99av.com| 久草视频国产在线| 日本高清一区二区视频| av7777777| 中文字幕第一页亚洲| 日韩一级片播放| 在线观看18视频网站| 91最新在线观看| 日本网站免费在线观看| 国产高清免费在线| 国产性生交xxxxx免费| 日本免费a视频| 成人av毛片在线观看| 人妻有码中文字幕| 17c丨国产丨精品视频| 免费在线观看污网站| 四虎永久在线精品无码视频| 四虎4hu永久免费入口| 欧美日韩一区二区三区69堂| 久久精品国产精品亚洲色婷婷| 男同互操gay射视频在线看| 一区二区三区免费播放| 在线视频一二区| 高清一区在线观看| 国产精品第12页| 久久精品国产sm调教网站演员| 国内外成人激情免费视频| 成人日韩在线视频| 高清一区二区视频| 欧美一级黄色片视频| 国产av国片精品| 性高湖久久久久久久久aaaaa| 性鲍视频在线观看| 亚洲欧美国产中文| 激情视频综合网| 日韩黄色片视频| 男人的天堂99| 国产精品宾馆在线精品酒店| 免费看毛片的网址| 国产91沈先生在线播放| 免费在线精品视频| 400部精品国偷自产在线观看| 日本成人xxx| 中文字幕在线视频一区二区三区| 三级av免费观看| 久久国产精品国产精品| 三上悠亚av一区二区三区| 免费看国产黄色片| 亚洲精品视频导航| www.精品在线| 欧美日韩中文不卡| 小明看看成人免费视频| 99热一区二区| 国内av一区二区| 色姑娘综合天天| 最新视频 - x88av| 午夜探花在线观看| 9191国产视频| 免费毛片网站在线观看| 黄色国产一级视频| 男人天堂999| 91香蕉视频导航| 国产福利在线免费| 亚洲女人在线观看| 97av中文字幕| 国产伦精品一区二区三区四区视频_| 国产原创中文在线观看 | av磁力番号网| 91精品一区二区三区四区| 永久免费看av| xxxx18hd亚洲hd捆绑| 日本精品www| 午夜dv内射一区二区| 99久久国产宗和精品1上映| 亚洲一区在线不卡| 想看黄色一级片| 黄色网在线视频| 日本www在线视频| 国产wwwxx| 裸体大乳女做爰69| 日韩小视频在线播放| 成人综合视频在线| 午夜宅男在线视频| 亚洲区成人777777精品| 免费看国产曰批40分钟| 午夜免费福利在线| 色噜噜狠狠一区二区三区狼国成人| 红桃一区二区三区| 国产一区二区在线视频播放| 久久久国产欧美| 在线观看av的网址| av天堂永久资源网| 欧美视频亚洲图片| 又大又硬又爽免费视频| 欧美伦理视频在线观看| 天天爱天天做天天操| 自慰无码一区二区三区| 亚洲这里只有精品| 国产乱淫av片杨贵妃| 成人一区二区三| 欧美少妇在线观看| www.日本xxxx| 人妻激情另类乱人伦人妻| 午夜欧美福利视频| 青青草视频国产| 国产九九热视频| 免费国产黄色网址| 在线免费黄色小视频| 日本三级免费观看| 奇米777四色影视在线看| 免费男同深夜夜行网站| 成人国产在线看| 在线观看国产福利| 国产极品粉嫩福利姬萌白酱| 国产精品h视频| 久久久国产欧美| 国产九九九九九| 看全色黄大色大片| 亚洲性生活网站| 999在线观看视频| 香蕉视频色在线观看| 色一情一乱一伦一区二区三区日本 | 妺妺窝人体色www在线小说| 久久久久亚洲av无码专区喷水| 日本a√在线观看|