0% found this document useful (0 votes)
136 views

Assignment 2 C#

This document provides details about an assignment submission for a programming unit, including: - Student and assignment details such as the student's name and ID, the unit name and number, and submission dates. - A grading grid to evaluate the submission. - Sections for summative feedback on the initial submission and resubmission feedback if needed. - Space for assessor signature and date and lecturer signature.

Uploaded by

HD Lee
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
136 views

Assignment 2 C#

This document provides details about an assignment submission for a programming unit, including: - Student and assignment details such as the student's name and ID, the unit name and number, and submission dates. - A grading grid to evaluate the submission. - Sections for summative feedback on the initial submission and resubmission feedback if needed. - Space for assessor signature and date and lecturer signature.

Uploaded by

HD Lee
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 24

ASSIGNMENT 2 FRONT SHEET

Qualification BTEC Level 5 HND Diploma in Computing

Unit number and title Unit 1: Programming

Submission date Date Received 1st submission

Re-submission Date Date Received 2nd submission

Student Name Minh Triet Student ID GCD19828

Class GCD0901 Assessor name Nhu Vinh Hoang

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

Grading grid

P2 P3 P4 P5 M2 M3 M4 D2 D3 D4

1 | Minh Triet
 Summative Feedback:  Resubmission Feedback:

Grade: Assessor Signature: Date:


Lecturer Signature:

2 | Minh Triet
Table of Contents
I. Introduction to your program ................................................................................................................. 5
1. Introduce the Overview/ Context of the problem .............................................................................. 5
2. List out application’s requirements ..................................................................................................... 5
II. Programming paradigms ......................................................................................................................... 6
1. What is Object-Oriented Programming (OOP) .................................................................................... 6
2. What is Procedural Programming ....................................................................................................... 7
3. What is Event-Driven Programming with source code and illustrations ............................................ 8
4. Paradigms will be used to develop program ....................................................................................... 9
III. IDE features ....................................................................................................................................... 10
1. Introduce what is IDE ........................................................................................................................ 10
2. Introduce features of IDE .................................................................................................................. 10
3. An explanation and evaluation of the debugging process in the IDE used and how it helped with
development. ........................................................................................................................................... 10
4. Evidences that you have used debugging during the implementation ............................................ 12
5. An evaluation of developing applications using an IDE versus developing an application without
using an IDE. ............................................................................................................................................. 12
IV. Design and Implementation .............................................................................................................. 13
1. Flowchart of the application ............................................................................................................. 13
2. Source code and screenshots of the final application with explanation .......................................... 14
3. Explain and evaluate coding standards used in the program ........................................................... 22
4. Explain the benefits of using coding standards ................................................................................. 23

3 | Minh Triet
Figure 1 Application Design ............................................................................................................................ 5
Figure 2 Example Class ................................................................................................................................... 6
Figure 3 Class and Objects .............................................................................................................................. 7
Figure 4 Example Procedural Programming ................................................................................................... 8
Figure 5 Event-Driven Programming .............................................................................................................. 8
Figure 6 Build project ..................................................................................................................................... 9
Figure 7 Debug.............................................................................................................................................. 11
Figure 8 Used Debug .................................................................................................................................... 12
Figure 9 Flowchart ........................................................................................................................................ 13
Figure 10 Application Source code ............................................................................................................... 14
Figure 11 Login source code ......................................................................................................................... 15
Figure 12 Login program .............................................................................................................................. 15
Figure 13 Table Produce management ........................................................................................................ 16
Figure 14 Lock control .................................................................................................................................. 17
Figure 15 Source code lock/open control .................................................................................................... 17
Figure 16 Open control ................................................................................................................................. 17
Figure 17 Edit feature ................................................................................................................................... 18
Figure 18 Code button Add .......................................................................................................................... 18
Figure 19 Add feature ................................................................................................................................... 18
Figure 20 Check() Functionn ......................................................................................................................... 19
Figure 21 Code Button Edit .......................................................................................................................... 19
Figure 22 Delete feature............................................................................................................................... 20
Figure 23 Example Check() Function ............................................................................................................ 20
Figure 24 Button Delete function ................................................................................................................. 20
Figure 25 DataGridproduce table ................................................................................................................. 21
Figure 26 Produce table ............................................................................................................................... 21
Figure 27 Exit application ............................................................................................................................. 21
Figure 28 Naming rule .................................................................................................................................. 22

4 | Minh Triet
I. Introduction to your program
1. Introduce the Overview/ Context of the problem
This client project required me to program an application to manage goods. In this project, customers
require to import and export product information to a screen for easy management.

2. List out application’s requirements


After I got into the client's needs I got an idea and started sketching the application with Visual Studio
First, I designed the login functionality so that the application required only the administrator to
manipulate the application.
My app will have functions like adding, modifying or deleting products
All product information is exported to the user-friendly screen for easy management.

Figure 1 Application Design

5 | Minh Triet
II. Programming paradigms
1. What is Object-Oriented Programming (OOP)
Object-oriented programming is about creating objects that contain both data and methods. As a result,
an entity is similar to a miniature program or a self-contained component, making the OOP solution more
modularized and therefore simpler to manage and expand. (Nguyen, March 30, 2020)

In OOP, there are 5 concepts such as: class, method, property, field, object

A class in object oriented programming represents a collection of objects with the same characteristics,
behavior, and operation methods.

In which the properties of the object are called fields, the properties of the object are shown externally
through properties of the class.

Figure 2 Example Class

6 | Minh Triet
In C # an object is an instance of a class. Class represents a set of objects that share characteristics and
behaviors. When you instantiate an instance of a class, that instance is the object.

Figure 3 Class and Objects

2. What is Procedural Programming


Procedural programming is a programming model that uses a linear or top-down approach. All functions
are handled in the main () function and in the main function can contain many other main handler
functions to combine to create the program. (Bhatia, January 8, 2021)

7 | Minh Triet
Figure 4 Example Procedural Programming

3. What is Event-Driven Programming with source code and illustrations


When you use certain software, for example, student management software, each operation on the
software must be through the mouse and keyboard, each action will affect a program in the software and
from there, the software will return the results to us. So that software has used the event for programming.
(Sharma, Oct 15,2017)

Figure 5 Event-Driven Programming

8 | Minh Triet
4. Paradigms will be used to develop program
In short, the programming methods have their own characteristics depending on the programmer's use.
In this project I used event-driven programming to solve the problem that the client delivered. I think
event-driven programming has enough customer elements such as ease of use, full operation functions,
and easy-to-manage interface.

It has full import and export and its good functioning instances

Figure 6 Build project

9 | Minh Triet
III. IDE features
1. Introduce what is IDE
IDE (Integrated Development Environment) is an integrated environment used to write code for
application development. To make it easy to understand, this is computer software that supports
programmers to write code, and they are packed with a lot of features to make coding simpler. In addition,
the IDE integrates other supporting tools such as compiler (Compiler), interpreter (Interpreter), error
checking (Debugger), formatting or highlighting code, organizing code directory, searching code ... (Anon.,
2020)

2. Introduce features of IDE

3. An explanation and evaluation of the debugging process in the IDE used


and how it helped with development.
Debug's purpose is not only to eliminate errors from the program, but more importantly to help the
programmer better understand the execution of the program. A programmer without effective Debug is
like being blind.

10 | Minh Triet
 The debugging process in the IDE

The IDE debugger allows you to change the values of variables at run time.

The IDE debugger lets you see the values of variables you don't know you want to see when you start your
execution.

The IDE debugger allows you to view call stacks and check the status of a function through unknown values.
(think this function is being called from hundreds of places, you don't know where these weird values
come from)

The IDE debugger allows you to break an execution condition at any point in the code, based on a
condition, not line numbers.

The IDE debugger will allow you to check the program's status in case an exception hasn't been handled
instead of just appearing.

 Evaluation

I believe that debugging is a great deal to learn for any creator. Once you know how you can do this, it is
faster to debug such error types than just an IDE. Programmers who know the procedure are therefore
very familiar with what information is required for debugging purposes in a log message..

Figure 7 Debug

11 | Minh Triet
4. Evidences that you have used debugging during the implementation

Figure 8 Used Debug

5. An evaluation of developing applications using an IDE versus developing


an application without using an IDE.
Using an IDE will save developers a lot of time because the utilities or configurations are already in place
by these IDEs. In addition, the use of IDEs to support the coding process will also make the work smoother,
so that the pressure is less, the work efficiency increases. The IDE is an integral part of the software
application development process. With the IDE and the tools it provides, it makes the programming
process more convenient, easy and error-less. In the absence of an IDE, you can write the source code
using the corresponding compiler of the programming language. This job will take a lot of time, add more
complicated steps, but not work as expected, especially programs with difficult programming steps.

Opposite, If you do not use IDE in C # you will find the program more difficult to manage and manipulate.
When the work environment does not allow the use of IDEs. Dat's choice is to use Vim or Sublime Text to
code. Because it's handy, everywhere. But if there is an IDE that helps Dat do everything handy, Dat will
choose the IDE.

Every time you code, you have to think a lot before compiling, because it will be error, and it will be difficult
to debug. I have to build my own debugging method for my product. At that time, there was no IDE that
could support it, so we had to use Editor.

12 | Minh Triet
IV. Design and Implementation
1. Flowchart of the application

Figure 9 Flowchart

13 | Minh Triet
2. Source code and screenshots of the final application with explanation
This is the main processing code in the application. Here I have fully programmed the features required by
the client. Programmed features work and do their job correctly

Figure 10 Application Source code

14 | Minh Triet
When starting the application I programmed to ask the user to enter a username and password to be able
to use the application.

Figure 12 Login program

Figure 11 Login source code

15 | Minh Triet
Here is the full source code for the login forms. Here I programmed two buttons "Login" and "Exit". If the
user logs in, the application will display a version to manipulate the features that the customer has
requested.

Figure 13 Table Produce management

The application is programmed based on customer requirements and has one of the following features:

 Add the product name


 Display product information on the screen
 Delete product
 Edit product information
 Exit the program

16 | Minh Triet
The "Save" feature is used to save product information on the screen. When the "Add" or "Edit" feature is
not selected, this feature cannot be operated.

Figure 14 Lock control

When you click on the operation, the "Add" or "Edit" feature "Save" will be active.

Figure 16 Open control

Figure 15 Source code lock/open control

When clicking the add button, the save button will be opened and the user will start filling in information.
Click on the save button, the product information will be displayed on the screen

17 | Minh Triet
Figure 19 Add feature

Figure 18 Code button Add

Figure 17 Edit feature

18 | Minh Triet
Figure 21 Code Button Edit

In this feature will find the location information changes and save it in the new value.

Figure 20 Check() Functionn

This function is used to check the information entered. If the required information is blank, the program
will notify the user.

19 | Minh Triet
Figure 23 Example Check() Function

Delete button

Figure 22 Delete feature

Find a row location and delete its information.

Figure 24 Button Delete function

20 | Minh Triet
Figure 27 Exit application

In the end to save all the data and display them on the app I used dataGridView. I will divide 4 columns to
store data corresponding to the 4 information that I enter. This function will find the location of each data
and pass it on.

Figure 26 Produce table

Figure 25 DataGridproduce table

21 | Minh Triet
3. Explain and evaluate coding standards used in the program
When programming a large project, it is necessary to join a team. In a group there are necessarily some
popular programming codes as follows:

Naming rules:

Names need to express their meaning explicitly. Avoid ambiguous, confusing naming schemes (most

Figure 28 Naming rule

programmers spend 80% on names).

Indent lines and spacing:

Enter the tab space for commands contained in the {} block.

Spacing a tab space for the statement immediately after if, else, while, for, foreach.

Write a space around the 2-person and 3-person operators.

Makes the source code easier to observe

Note:

Encourage comments on confusing code or special functions. The language used for comments must be
in sync throughout the program.

22 | Minh Triet
4. Explain the benefits of using coding standards
Coding standards help master object programming in C #. Programmers have standards that make code
management easier to simplify source code and have brought a number of benefits such as

Code-writing will make it easier for team or project members to read each other's code, as well as easier
to maintain and correct errors.

It is more convenient for other developers when they learn old projects to develop more

Build up a set of rules that are common to the system or project.

They give a consistent look to the code, so readers can focus on the content, not the layout.

They allow readers to understand code faster by making assumptions based on previous experience.

23 | Minh Triet
V. References
Anon., 2020. TopDev. [Online]
Available at: https://topdev.vn/blog/ide-la-gi/
[Accessed 20 4 2021].

Bhatia, S., January 8, 2021. Hackr. [Online]


Available at: https://hackr.io/blog/procedural-programming
[Accessed 24 4 2021].

Nguyen, T., March 30, 2020. Comdy. [Online]


Available at: https://comdy.vn/c-sharp/lap-trinh-huong-doi-tuong-oop-trong-c-sharp/
[Accessed 24 4 2021].

Sharma, V., Oct 15,2017. vsvaibhav2016. [Online]


Available at: https://vsvaibhav2016.medium.com/introduction-to-event-driven-programming-
28161b79c223
[Accessed 24 4 2021].

24 | Minh Triet

You might also like