首页 新闻 聚焦 科技 财经 创业 综合 图片 视频

IT界

旗下栏目: 行业 生态 IT界 创新

辅导CSCI 1110程序、辅导Java编程语言

来源:互联网 发布时间:2021-04-12
辅导CSCI 1110程序、辅导Java编程语言
CSCI 1110 – Fall 2020
Assignment 04 – Due 11/04, 11 pm
Please start this assignment early; programming and logic take time - if you leave it to the last
minute, you might not have enough time to finish or might make silly mistakes that you otherwise
could avoid. Note that TAs and Instructors will not be able to answer last-minute questions!
All work is to be handed in Mimir, our online code learning environment. You should, however,
write your code on an IDE such as IntelliJ.
To complete this assignment, you will need to know about:
• Basic Java
• Conditionals
• Boolean Variables
• Loops
• Objects and Classes
• Java Collections Framework (Lists, Sets, Maps, Queues, Stacks)
Your code must compile. If it does not compile, you will receive a 0 (zero) on that portion of the
assignment, and no partial marks will be given.
Remember that students who hardcode their outputs to match the test cases in Mimir will
receive a zero on the entire assignment.
Grading Scheme: Please see the grading scheme at the end of this document.
Coding Style: You must proper variable names and comments. Please follow the guidelines on
https://web.cs.dal.ca/~franz/CodingStyle.html
Problem Overview
In this assignment, you will finish implementing a set of classes used to represent Students,
Courses and a University.
This assignment is meant for you to write code using the JFC collections (lists, sets, maps,
queues, etc.) and their built-in algorithms (e.g., contains method). Your goal is to read through
the already written javaDocs and fix the variable declarations and methods flagged with a ToDo
comment (//TODO).
You can create other private methods and variables if you want, but you don't have to. You also
don't have to add any more JavaDocs; however, inline comments are still required on the
methods you write code on.
The two classes you have to work in are University.java and Student.java.
Iterators on Maps
We discussed iterators in lectures 14 and 15. Iterators are what a foreach loop uses
"underneath the surface." We also explored how to retrieve an iterator from a List and use it to
iterate over (and even remove) the collection using while loops.
You cannot get an iterator from a Map directly since the stored information is associated with a
tuple of keys and values. To iterate on a map, you have to get the keys from the map and
iterate over them. Example:
• Assume that you have a map that associates Farms and Cows (<Farm,Cow>). The keys to
the map are Farm objects.
• You can retrieve the keys already on the map by calling the keySet() method on the map
variable. It will return a set of keys (Set<Farm>). You can then get the iterator of a set
the same way you do for lists.
o Another way to go over every element on the map is to use the values() method
on the map variable. This method will return a Collection<value>.
o It is up to you to chose which path you want to follow
For the curious among you
I added some extra code in the Student and Course classes:
• StringBuilder: we should use a SB to concatenate strings on loops instead of +=
because everytime we are using += we are instantiating a new String (they are
imutable)
• Saving and loading objects to a binary file (Student class): you can write another
class on your computer to toy with those two methods.
Grading Scheme
Each problem on the assignment will be graded based on three criteria:
Functionality
"Does it work according to  Specifications?" This is determined in an automated fashion by
running your program on a number of inputs and ensuring that the outputs match the expected
outputs. The score is determined based on the number of tests that your program passes.
Quality of Solution
"Is it a good solution?" This considers whether the solution is correct, efficient, covers boundary
conditions, does not have any Obvious bugs, etc. This is determined by visual inspection of the
code. Initially full marks are given to each solution and marks are deducted based on faults
found in the solution.
Code Clarity
"Is it well written?" This Considers whether the solution is properly formatted, welldocumented,
and follows coding style guidelines
(https://web.cs.dal.ca/~franz/CodingStyle.html).
If your program does not compile, it is considered non-functional and of extremely poor quality,
meaning you will receive 0 for the solution.
PROBLEM POINTS
MIMIR TEST CASES 80
QUALITY OF SOLUTION &
CODE CLARITY
20
TOTAL 100
 
请加QQ:99515681 或邮箱:99515681@qq.com   WX:codehelp
  免责声明:珠穆朗玛网对于有关本网站的任何内容、信息或广告,不声明或保证其正确性或可靠性,用户自行承担使用网站信息发布内容的真假风险。
责任编辑:珠穆朗玛网