首页 > > 详细

辅导HW5辅导Java程序、Java编程解析

CSE 2010, HW5
Due Tue Apr 7 at the start of your lab section; Submit Server: class = cse2010, assignment = hw5SxIndividual
Due Tue Apr 7 at the end of your lab section; Submit Server: class = cse2010, assignment = hw5SxGroupHelp
x is 14 or 23—(j for java).
Consider a wearable activity tracker similar to Fitbit that tracks activities related to your health. How would you design
a system such that it can efficiently find and display activities during a certain period of time?
The goal of HW5 is to allow the user to specify a time range to display the corresponding activities. Also, we would like
the system to be able to add and remove (erroneous) activities as the user performs those activities (such as walking, running,
swimming, ...)
To improve efficiency, your implementation has at least the following operations for a skip list:
• get(k) [p. 403; pseudocode is on p. 439]
• put(k, v) [p. 403; pseudocode is on p. 440]
• remove(k) [p. 403; p. 441]
• subMap(k1, k2) [p. 428]
You can rewrite or modify doublyLinkedList.c and incorporate it into your program file (hw5.c). Use getRandHeight() from
fakeRandheight.c for put(k, v) (to facilitate eaiser debugging and testing). Sample instruction for compilation: “gcc -o hw5
hw5.c fakeRandomHeight.c”. Program files are on the course website.
We will evaluate your submissions on code01.fit.edu so we strongly recommend you to test your programs on code01.fit.edu.
To preserve invisible characters, we strongly recommend you to download, NOT copy and paste, input data files.
Input: The command-line argument for hw5.c is the name of a file, which has one of the following actions on each line:
• AddActivity time activity
• RemoveActivity time
• GetActivity time
• GetActivitiesBetweenTimes startT ime endT ime
• GetActivitiesForOneDay date
• GetActivitiesFromEarlierInTheDay currentT ime
• PrintSkipList
For simplicity, time is an integer in MMDDHHmm format and date is in MMDD format (MM is 01-12, DD is 01-31, HH is
00-23, mm is 00-59) [leading zero in MM is optional]. The timestamps are unique and each timestamp can only have at most
one activity. Sample input is on the course website.
Output: Output goes to the standard output (screen), each line has a result for the corresponding action:
• AddActivity time activity [ExistingActivityError:existingActivity]
• RemoveActivity time activity/NoActivityError
• GetActivity time activity/none
• GetActivitiesBetweenTimes startT ime endT ime time1:activity1 ... or none
• GetActivitiesForOneDay date time1:activity1 ... or none
• GetActivitiesFromEarlierInTheDay currentT ime time1:activity1 ... or none
• PrintSkipList
(Sh) empty
...
(S1) time1:activity1 ...
(S0) time1:activity1 ...
Sample output is on the course website.
Submission: Submit hw5.c that has the main function, and other program files. Submissions for Individual and GroupHelp
have the same guidelines as HW1. No need to submit fakeRandHeight.c, which will be overwritten by the provided version if
you do.
For Extra Credit, submit hw5extra.c and related program files.
Note the late penalty on the syllabus if you submit after the due date and time as specified at the top of the assignment.

联系我们
  • QQ:99515681
  • 邮箱:99515681@qq.com
  • 工作时间:8:00-21:00
  • 微信:codinghelp
热点标签

联系我们 - QQ: 99515681 微信:codinghelp
程序辅导网!