

























Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
ASM2 - 1651 - Hope it can help u get pass
Typology: Assignments
1 / 33
This page cannot be seen from the preview
Don't miss anything!


























Qualification BTEC Level 5 HND Diploma in Computing Unit number and title Unit 20: Advanced Programming Submission date Date Received 1st submission Re-submission Date Date Received 2nd submission Student Name Dương Trọng Quí Student ID GBS Class GCS1005A Assessor name Nguyen Van Son Student declaration I certify that the assignment submission is entirely my own work and I fully understand the consequences of plagiarism. I understand that making a false declaration is a form of malpractice. Student’s signature Quí Grading grid P1 P2 M1 M2 D1 D
ASSIGNMENT 2 BRIEF Qualification BTEC Level 5 HND Diploma in Computing Unit number and title Unit 2 : Advanced Programming Assignment title Application development with class diagram and design patterns Academic Year 2022 - 2023 Unit Tutor Nguyen Van Son Issue date Submission date Submission Format: Format: The submission is in the form of an individual written report. This should be written in a concise, formal business style using single spacing and font size 12. You are required to make use of headings, paragraphs and subsections as appropriate, and all work must be supported with research and referenced using the Harvard referencing system. Please also provide a bibliography using the Harvard referencing system. Submission Students are compulsory to submit the assignment in due date and in a way requested by the Tutors. The form of submission will be a soft copy in PDF posted on corresponding course of http://cms.greenwich.edu.vn/ together with zipped project files. Note: The Assignment must be your own work, and not copied by or from another student or from books etc. If you use ideas, quotes or data (such as diagrams) from books, journals or other sources, you must reference your sources, using the Harvard style. Make sure that you know how to reference properly, and that understand the guidelines on plagiarism. If you do not, you definitely get fail Assignment Brief and Guidance: Scenario : (continued from Assignment 1) Your team has shown the efficient of UML diagrams in OOAD and introduction of some Design Patterns in usages. The next tasks are giving a demonstration of using OOAD and DP in a small problem, as well as advanced discussion of range of design patterns. Tasks: Your team is now separated and perform similar tasks in parallel. You will choose one of the real scenarios that your team introduced about DP in previous phase, then implement that scenario based on the corresponding class diagram your team created. You may need to amend the diagram if it is needed for your implementation. In additional, you should discuss a range of DPs related / similar to your DP, evaluate them against your scenario and justify your choice. In the end, you need to write a report with the following content:
ASSIGNMENT 2 ANSWERS
Trần Ngọc Gia Hoàng – GCS Dương Trọng Quí – GBS
In assignment 1, our group presented the effectiveness of UML diagrams in object-oriented analysis and design (OOAD) and introduced some Design patterns in use. Therefore, in this assignment 2, our group will present the application of OOAD and design patterns in a scenario, as well as an advanced discussion of the scope of design patterns. Building an application utilizing the C# programming language to manage student information and activities in a learning environment. To achieve these goals, we have decided to create a program encompassing functionalities such as adding and displaying student information, sorting, and searching for students. We intend to equip my program with a straightforward and user-friendly interface, utilizing the console interface. Users will interact with the program via the keyboard. The program will be developed using the C# programming language and Visual Studio IDE.
2.1. Scenario: Student management at the University of Greenwich is becoming more and more challenging as it grows. We must develop software that can control student behavior in the classroom. The software enables the management of student data such as ID, name, age, phone number, email, and grades. The application for this project is built on the principles of object-oriented programming, with C# serving as the main language. We also highlight the greatest OOP design and programming patterns in this study and provide the best software development methodology as a result. The OOAD application will be implemented using the UML class diagram design, and the classes in the source code will follow the OOAD principles.
3.1. Code: This code allows the manager to manage a student management system by adding, editing, searching, sorting, letting status student and deleting student from a student table, as well as displaying all students in the table.
Figure 3 : Class Menu The Menu will include the following main functions:
Figure 4 : Class Program
Figure 6 : Add student code (2) The section that requires the user to enter the student's score, similar to age, uses a do-while loop to check the validity of the score. Use double. TryParse() to check the validity of the input and grade values should not be greater than 10. If the score is invalid, the corresponding error message will be displayed.
Figure 8 : Search student code SearchStudentByID() The Find() function is used to find students in the students list with the condition s.ID == id. If found, the corresponding Student object will be returned and assigned to the student variable. If the other student is null, i.e. the student has been found, the student's information will be displayed, including ID, name, age, number The Find() function is used to find students in the students list with the condition s.ID == id. If found, the corresponding Student object will be returned and assigned to the student variable. If the other student is null, i.e. the student was found, the student's information will be displayed, including ID, name, age, phone number, and grades. If the student with the given ID is not found, the message that "Student with the given ID was not found." will be displayed.điện thoại và điểm. If the student with the given ID is not found, the message that "Student with the given ID was not found." will be displayed. SearchStudentByName() The FindAll() function is used to find all students in the students list whose names contain the name string. The StringComparison.OrdinalIgnoreCase parameter allows lowercase insensitive searches. If any students are found, the foundStudents list will contain students who meet the search eligibility.
Using the parameter of the Sort() method, a lambda expression is passed to define how the two students compare (s1 and s2). In this case, s1. Age.CompareTo(s2. Age) is used to compare the ages of two students. The CompareTo() method returns a negative value if s1. Age is less than s2. Age, return 0 if equal, and return a positive value if s1. The age is greater than s2. Age. After the list has been sorted, the message "Student list sorted by age:" will be displayed. The DisplayStudents() function is called to display a list of students sorted by age.
The Find() function is used to find students in the students list with corresponding IDs. If found, the corresponding Student object will be assigned to the student variable. If the other student is null, i.e. the student has been found, the user will be asked to enter new information for the student. Console.WriteLine line($"Editing Student ID: {student.ID}"); print out a message that the student's information with the corresponding ID is being edited. The user is required to enter new information: name, age, phone number and points. Use int. TryParse() to check the validity of the age of entry. If valid, the user will be asked to enter a new phone number and a new point. Use double. TryParse() to check the validity of the entry point. If valid, student information will be updated with new information and the message "Student information updated successfully." will be displayed. If the age or score is invalid, an error message will be displayed accordingly. If the student with the given ID is not found, the message that "Student with the given ID was not found." will be displayed.
If the student with the given ID is not found, the message that "Student with the given ID was not found." will be displayed. 3.2. Program screenshots: Menu: Student management menu interface. Figure 13 : Menu Add new student: Select button 1 and add student information to the program. Figure 14 : Add new student (1) Figure 15 : Add new student (2) Display student list: Added students will be saved to the program and when button 2 is selected, all existing and newly added students will be displayed.
Figure 16 : Display student list Search student by ID: Button number 3 will let users search for students by ID. Figure 17 : Search student by ID (1) Figure 18 : Search student by ID (2) Search student by Name: Button number 4 will let users search for students by Name. Figure 19 : Search student by Name (1) Figure 20 : Search student by Name (2) Sort Student List by Name: Button number 5 will allow users to sort students alphabetically.