INFO1113 Assignment

INFO1113 Assignment 1
Due: September 22nd, 11:59PM AEST
This assignment is worth 6% of your final assessment
Task Description
In this assignment we will develop a key value store database called CrunchDB in the Java programming
language using dynamic data structures. All entries to the database contain a unique key which
will map to a set of values. Each entry of the database is identified by a unique key string and contains
a dynamically sized list of integer values.
You are encouraged to ask questions on Ed using the assignments category. As with any assignment,
make sure that your work is your own, and you do not share your code or solutions with other students.
Working on your assignment
You can work on this assignment on your own computer or the lab machines. It is important that you
continually back up your assignment files onto your own machine, external drives, and in the cloud.
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.
1
INFO1113
Implementation details
Write a program in Java that implements CrunchDB as shown in the examples below. You can assume
that our test cases will contain only valid input commands and not cause any integer overflows. Keys
are case sensitive and do not contain spaces. Commands are case insensitive.
Entry values are indexed from 1. Snapshots are indexed from 1 and are unique for the lifetime of the
program. Keys, entries and snapshots are to be outputted in the order from most recently added to

INFO1113留学生作业代做、Java课程设计作业代做
least recently added. Snapshots can be archived in a human-readable text file, storing all entries in the
following form
<entry_key>|[<entries>,...]}
Example
a|1,2,3,4
b|3,4,5
c|9,6,1,2,0,3
Archived snapshots can be restored by CrunchDB, resetting the data to the archived snapshot’s state.
Your program can be contained in the provided scaffold of CrunchDB.java, Snapshot.java
and Entry.java. Do not modify any of the existing method signatures in these files. Your program
must produce no errors when built and run on the lab machines and Ed. Your program will read from
standard input and write to standard output.
Your program output must match the exact output format shown in the examples and on Ed. You
are encouraged to submit your assignment while you are working on it, so you can obtain some
feedback. You have been provided simple skeleton classes and hints on how to implement your
snapshot database.
In order to obtain full marks, your program will be checked against automatic test cases, manually
inspected by your tutors and you must submit a set of test cases that ensure you have implemented
functionality correctly.
Page 2 of 10
INFO1113
Commands
Your program should implement the following commands, look at the examples to see how they work.
• If a <key> does not exist in the current state, output: no such key
• If a <snapshot> does not exist in the database, output: no such snapshot
• If an <index> does not exist in an entry, output: index out of range
BYE clear database and exit
HELP display this help message
LIST KEYS displays all keys in current state
LIST ENTRIES displays all entries in current state
LIST SNAPSHOTS displays all snapshots in the database
GET <key> displays entry values
DEL <key> deletes entry from current state
PURGE <key> deletes entry from current state and snapshots
SET <key> <value ...> sets entry values
PUSH <key> <value ...> pushes values to the front
APPEND <key> <value ...> appends values to the back
PICK <key> <index> displays value at index
PLUCK <key> <index> displays and removes value at index
POP <key> displays and removes the front value
DROP <id> deletes snapshot
ROLLBACK <id> restores to snapshot and deletes newer snapshots
CHECKOUT <id> replaces current state with a copy of snapshot
SNAPSHOT saves the current state as a snapshot
ARCHIVE <id> <filename> saves snapshot to file
RESTORE <filename> loads and restores snapshot from file
MIN <key> displays minimum value
MAX <key> displays maximum value
SUM <key> displays sum of values
LEN <key> displays number of values
REV <key> reverses order of values
UNIQ <key> removes repeated adjacent values
SORT <key> sorts values in ascending order
DIFF <key> <key ...> displays set difference of values in keys
INTER <key> <key ...> displays set intersection of values in keys
UNION <key> <key ...> displays set union of values in keys
CARTPROD <key> <key ...> displays cartesian product of sets
> BYE
Writing your own testcases
We have provided you with some test cases but these do not not test all the functionality described in
the assignment. It is important that you thoroughly test your code by writing your own test cases.
You should place all of your test cases in the tests/ directory. Ensure that each test case has the .in
input file along with a corresponding .out output file. We require that the names of your test cases are
descriptive so that you know what each is testing, e.g. get-set.in and sort-uniq.in and we
can accurately and quickly assess your test cases.
Submission Details
Final deliverable for the correctness and manual inspection will be due on the 22nd of September
2019.
You must submit your code and tests using the assignment page on Ed. To submit, simply place your
files and folders into the workspace, click run to check your program works and then click submit.
You are encouraged to submit multiple times, but only your last submission will be considered.
Marking
You will only be given valid inputs as part of the automatic test suite. Your program will be checked
for errors that a user can possibly make. In addition, we will mark your program against a substantial
collection of hidden test cases.
3 marks are assigned based on automatic tests for the correctness of your program. This component
will use hidden test cases that cover every aspect of the specification. Your program must match the
exact output in the examples and the test cases on Ed. Test cases will be released progressively, the
final set of public test cases will be released prior to 17th of September.
3 marks are assigned based on a manual inspection of the style (1 mark) and tests cases (2 marks).
Make sure that you carefully follow the assignment specifications and thoroughly test your code,
optimising for coverage and testing for a variety of input ranges.
Page 9 of 10
INFO1113
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.

因为专业,所以值得信赖。如有需要,请加QQ:99515681 或邮箱:[email protected]

微信:codehelp

原文地址:https://www.cnblogs.com/toyma/p/11528980.html

时间: 2024-10-25 17:42:28

INFO1113 Assignment的相关文章

Algorithm Part I:Programming Assignment(2)

问题描述: Programming Assignment 2: Randomized Queues and Deques Write a generic data type for a deque and a randomized queue. The goal of this assignment is to implement elementary data structures using arrays and linked lists, and to introduce you to g

RailsCast26 Hackers Love Mass Assignment rails中按params创建、更新model时存在的安全隐患

Mass assignment是rails中常用的将表单数据存储起来的一种方式.不幸的是,它的简洁性成了黑客攻击的目标.下面将解释为什么及如何解决. 上述表单为一个简单的注册表单.当用户填入name,点击提交时,一个新用户被创建.用户模型被如下定义: ruby create_table :users do |t| t.string :name t.boolean :admin, :default => false, :null => false end 当用户点击提交时,如下的action被执

hdu4781 Assignment For Princess(构造)

题目链接:hdu4781 Assignment For Princess 题意:n个点m条边,每条有向边的权值分别是1,2,3…m,一个点能到达任意一个点,没有重边和自环,没有任何两条边的权值相同,任意一个有向环的权值和必须是3的倍数,现在需要把这个图输出来. 题解:注意到题目给出的范围m >= n+3,所以一定是可以构造出一个1~n的回路使得权值和为3的倍数的,可以让前n-1条边权值为1~n-1,第n条边(n->1)可以为n, n+1, n+2从而满足题意,后面再连任意两条不相邻的边时,边权

&lt;Effective C++&gt;读书笔记--Ctors、Dtors and Assignment Operators

<Item 5> Know what functions C++ silently writes and calls 1.If you don't declare them yourself, compilers will declare their own versions of a copy constructor, a copy assignment operator, and a destructor. Furthermore, if you declare no constructo

POJ 3189 Steady Cow Assignment(最大流)

POJ 3189 Steady Cow Assignment 题目链接 题意:一些牛,每个牛心目中都有一个牛棚排名,然后给定每个牛棚容量,要求分配这些牛给牛棚,使得所有牛对牛棚的排名差距尽量小 思路:这种题的标准解法都是二分一个差值,枚举下界确定上界,然后建图判断,这题就利用最大流进行判断,值得一提的是dinic的效率加了减枝还是是卡着时间过的,这题理论上用sap或者二分图多重匹配会更好 代码: #include <cstdio> #include <cstring> #inclu

hdu 1845 Jimmy’s Assignment (二分图)

Jimmy's Assignment Time Limit: 1000/1000 MS (Java/Others)    Memory Limit: 65535/65535 K (Java/Others) Total Submission(s): 896    Accepted Submission(s): 379 Problem Description Jimmy is studying Advanced Graph Algorithms at his university. His most

FreeRTOS的application assignment

Please follow the steps precisely in order to complete the objectives of the assignment. If you use the C++ FreeRTOS framework, it should make the assignment significantly easy. Create a producer task that takes 1 light sensor value every 1ms. Collec

用户无法进入SDSF,报NO GROUP ASSIGNMENT错误

注:命令行小写部分表出需要根据自己的情况改变!! a)激活SDSF资源类 SETROPTS CLASSACT(SDSF) b)查看SDSF资源类的PROFILE RLIST SDSF * c)如果不存在GROUP.ISFUSER.servername的PROFILE,则需要定义, RDEFINE SDSF (GROUP.ISFUSER.servername) OWNER(userid or group name) UACC(READ) 这样,所有用户都可以有读取权限,就都可以访问SDSF了 附1

遇到local variable &#39;e&#39; referenced before assignment这样的问题应该如何解决

问题:程序报错:local variable 'e' referenced before assignment 解决:遇到这样的问题,说明你在声明变量e之前就已经对其进行了调用,定位到错误的地方,对变量进行重新的声明 通常这样的问题对于python的程序员来说都是因为习惯了python2的语法,转移到python3中时,出现的错误.在Python3中,异常对象无法在异常块作用域外访问.(原因是在垃圾收集器运行且从内存中清理引用之前会在内存栈帧中保存一个引用周期)通常参考下面这个例子来做异常处理: