首页 > > 详细

COMP282 Coursework 2 – C#

  

University of Liverpool
Department of Computer Science
COMP282 – Advanced Object-Oriented C Languages
Coursework 2 – C#
Deadline: Thursday 13th May at 17:00
Weighting: 50%
Make sure your student ID is clearly shown in a comment at the top of your source code. Compress your
Visual Studio project into a single zip file and submit it via SAM. Penalties for late work will be applied in
accordance with the Code of Practice on Assessment.
Project Overview
You will create a small Windows GUI application
to input details about people, manipulate them,
and edit them. The project consists of several
tasks, which you should tackle in order. Each task
builds on the previous one. Do as much as you
can and then submit your project.
Read through this entire document before you
start coding, so you are aware of all the tasks and
the overall structure of the program. Your
solution should demonstrate your knowledge of
C# and GUI development with Visual Studio.
Important: Each task requires you to add extra
code. You shouldn’t need to remove any code.
Keep the code from previous tasks in your
program so we can see it and mark it.
Unlike Coursework 1, there is no risk that later
tasks could erase the work of earlier ones. You
can work within the same source files for each
task.
Note: Much of the code will be generated for you
by Visual Studio. We’ll mark the code you write.
User Interface & User Experience Design
Your application should look something like the screenshots shown below. It doesn’t have to be identical
but it should have the same buttons and controls.
The solution is shown working and discussed in the accompanying video. Please watch this to get a good
idea of how your application should behave.Part 1 (Worth 20%)
Task 1 – Person Class Definition (5%)
Create a Person class that stores a name and age. The name should be stored as a string, and the age as an
integer. Implement a constructor that takes appropriate parameters and stores them in the object. Also
implement the appropriate C# property getters and setters.
Task 2 – Form Layout (15%)
Use the Visual Studio layout designer to create a form similar to that shown above on the left. At this stage
the application should be runnable. When it’s run, the form window should be displayed without any build
errors, although it will not do anything apart from terminate correctly when the user closes the window.
Part 2 (Worth 55%)
Task 3 – Adding People (Internal and Visual) (15%)
Use a relevant C# container class to store Person objects. Implement the code that runs when the user
clicks the Add button. Your code should retrieve the text entered into the Name and Age boxes, convert
them into a Person object, and store that object in the collection. You should also update the GUI so the
added person appears in the large list area. Use the format shown above on the right (or very similar).
Task 4 – Removing People (Internal and Visual) (20%)
Implement the code that runs when the user clicks the Remove button. Your code should find out which
item in the list is currently selected (represented by the blue background) and remove it.
Important: Make sure you remove the item from both the internal list and the visible display. Be sure to
check the index of the removed item to prevent runtime out-of-bounds errors.
Task 5 – Updating Person Data (20%)
When the user clicks on an item in the visible list (or uses the keyboard to move up and down the list), the
Name and Age text boxes should be updated to reflect the current selection.
Implement the code that runs when the user clicks the Update button. Your code should update the
current selection with whatever text is currently in the Name and Age boxes. You should update both the
internal data collection and the visible list.
Part 3 (Worth 25%)
Task 6 – Sorting by Name and Age (15%)
Implement comparison methods in the Person class called CompareByName() and CompareByAge(). Add
the code that runs when the user clicks the Name Sort and Age Sort buttons. The internal data collection
should be sorted accordingly, and the visible list should be updated (redrawn) to reflect the change.Task 7 – General UX Improvements & Robustness (10%)
One of the biggest challenges is to make sure the blue highlight (current selection) stays visible when the
list changes. For example, when the currently selected item is removed, you need to decide what should
become the new current selection, then set the blue highlight accordingly. This is actually more
complicated than it sounds. For this task, add any necessary code to ensure the blue highlight remains
visible when there is data in the list.
You should also ensure there is consistency between the current selection and the values shown in the
Name and Age boxes. Add validation code so that the application doesn’t crash when the user clicks
Update or Remove with an empty list, and any other checks that you deem necessary for a robust
implementation.
How to Submit
Locate your Visual Studio project folder and compress it into a single .zip archive. If you use any other
format we won’t be able to extract and mark your work. Rename your archive so it has the module code
and your student ID in the filename (eg. comp282_cw2_201212345.zip).
If you want to draw our attention to anything, make a comment in the code itself. We will not read or mark
any other documents.
Submit your archive via SAM (https://sam.csc.liv.ac.uk/COMP/CW_Submissions.pl). You can submit
multiple attempts. If you submit more than one, we will only look at and mark the most recent.
Marking Descriptors
We draw your attention to the standard Department Grade Descriptors, which are listed in the Student
Handbook.
联系我们
  • QQ:99515681
  • 邮箱:99515681@qq.com
  • 工作时间:8:00-21:00
  • 微信:codinghelp
热点标签

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