Download assignment 2 programming for C# and more Thesis Information Technology in PDF only on Docsity!
ASSIGNMENT 2 FRONT SHEET
Qualification BTEC Level 5 HND Diploma in Computing Unit number and title Unit 1: Programming Submission date 14 / 8 Date Received 1st submission Re-submission Date Date Received 2nd submission Student Name Truong Van Diep Student ID BH Class SE06203 Assessor name NGUYEN TRONG HUNG 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 DIEP Grading grid P2 P3 P4 P5 M2 M3 M4 D2 D3 D
❒ Summative Feedback: ❒ Resubmission Feedback: Grade: Assessor Signature: Date: Lecturer Signature:
- I. Introduction
- II. Programing Paradigms..............................................................................................................................................
- Procedural Programing
- 2 , Object Oriented Programming
- 3 , Event Driven Programming
- 4 , Comparsion
- III. IDE usage in development.......................................................................................................................................
- Common IDE features
- 2 , IDE usage
- a, IDE used in my program
- b, Evaluation of IDE usage
- IV. Program results
- 1, Activity Diagram
- Explaination
- a, Design
- b, Code.................................................................................................................................................................
- V. Reference
- FIGURE 1: CHARACTERISTIC OF POP
- FIGURE 2: EXAMPLE ABOUT CLASS AND OBJECT
- FIGURE 3 : EXAMPLE
- TABLE 1 : COMPARSION
- FIGURE 4 : SOME POLULAR IDES
- FIGURE 5 : USE OF IDE
- FIGURE 6 : EXAMPLE OF CODE EDITOR
- FIGURE 7 : EXAMPLE OF MINIMIZETHE CODE BLOCK
- FIGURE 8 : EXAMPLE OF DEBUG
- FIGURE 9 : DESIGN
- FIGURE11 :ACTIVITY DIAGRAM OF BUTON ADD..............................................................................................................................................................
- FIGURE12 :ACTIVITY DIAGRAM OF BUTON EDIT
- FIGURE13 :ACTIVITY DIAGRAM OF BUTON DELETE
- FIGURE14 :ACTIVITY DIAGRAM OF CELLCLICK
- FIGURE15 :ACTIVITY DIAGRAM OF BUTON SEARCH
- FIGURE16 :ACTIVITY DIAGRAM OF BUTON BUY
- FIGURE 17 : DESIGN FORM (TAB ADD NEW BOOK)
- FIGURE 18 : DESIGN FORM (TAB MANAGE BOOK
- FIGURE 19 : FORM LOGIN
- FIGURE
- FIGURE 21 : CODE FORM LOGIN..............................................................................................................................................................................................
- FIGURE 22 : BUTTON ADD
- FIGURE 23 : BUTTON EDIT, EVENT CELLCLICK
- FIGURE 24 BTNCLICK
- FIGURE 25 : BUTN SEARCH
- FIGURE 26 BTN BUY.................................................................................................................................................................................................................
I. Introduction After passing the interview round with a presentation to demonstrate his problems solving ability and basic programming skills. Now, a more challenging task is to create a secure working application that is designed using an IDE and adheres to coding standards for a detailed business problem. Along with that is an explanation of programming languages Problem statement The solution to a detailed business problem is to create an application using an IDE. It's an application that helps the management of a bookstore. The assigned task is to help staff manage book information including genre, title, author and producer when customers request to provide and learn. Besides, profit after each sale... The application will be designed using the Winforms of the Microsoft Visual Studio. Scenario Before going to the next part, let's build the scenario to complete the task better:
- About your program
- Explain some programming paradigms: procedural programming, object-oriented programming, event programming and compare them with each other.
- Explain the general features of the IDE and its use to manage your code development.
- Evaluate application development using an IDE versus developing an application without using an IDE.
- Explain and evaluate the debugging process in the IDE used and how it helped development.
- Explain and evaluate the coding standards used in your program and the benefits to them **II. Programing Paradigms
- Procedural Programing** Procedural Programing tell the computer exactly how to solve a problem in a step - by maner .Would be found (usually a file on a mainframe computer), its exact format, and so on. With procedural programming, there were very few surprise - and very little user interaction” (Smiley, 2010). Or according to a study by Harvey (2013) Procedural Programming could be a term utilized to represent the way in which a computer software engineer composes a program. This strategy of creating program, which too is called an application, revolves around keeping code as brief as conceivable. It moreover centers on an awfully particular conclusion result to be
Basic characteristics of OOP:
- Encapsulation
- Inheritance
- Polymorphism
- Abstraction Figure 2: Example about Class and Object 3 , Event Driven Programming According to Gittleman (2005) Event-driven programming may be a programming paradigm where the stream of execution is decided by events like clicks or inquiry comes about from a database. Events are dealt with by event handlers or event. “An event is something that causes an event- driven program to perform an action. This broad definition allows many programs to be understood as event – driven” (Williams, et al., 2019). In other words, Event Driven Programming is the dominant paradigm used in graphical user interfaces and other applications that focus on performing certain actions in response to user input. For example, a simple program that prints either Hello or World depending in user input:
Figure 3: Example A trivial event handler Because the code for checking of events and the main loop are common amongst applications, many programming frameworks take care of their implementation and expect the user to provide only the code for the event handlers. In this simple example, there may be a call to an event handler called OnKeyEnter() that includes an argument with a string of characters, corresponding to what the user typed before hitting the ENTER key. To add two numbers, storage outside the event handler must be used. The implementation might look like below. globally declare the counter K and the integer T. OnKeyEnter(character C) { convert C to a number N if K is zero store N in T and increment K otherwise, add N to T, print the result and reset K to zero } While keeping track of history is normally trivial in a sequential program because event handlers execute in response to external events, correctly structuring the handlers to work when called in any order can require special attention and planning in an event-driven program. Characteristics:
- Service-oriented: The main function is used to create a service program without affecting the computer's processing because the service is directed to the target service. It is usually a service that runs in the background of the operating system.
- Time driven: In driven programming, timing is a pattern, it's a time code trigger,
III. IDE usage in development
1. Common IDE features An integrated development environment (IDE) is an application that facilitates application development. It provides programmers with integrated other support tools such as compiler, interpreter, error checker (Debugger), code formatting or highlighting, code directory organization, code search, ... In other words, IDE is a working graphical user interface (GUI) designed to assist developers in building software applications with an integrated environment that combines all the tools necessary. And selecting a good IDE is based on factors, such as language support, operating system (OS) needs and costs associated with using the IDE etc. Nowadays there are popular IDE as in use including Microsoft Visual Studio, Xcode, NetBeans, IntelliJ IDEA, ... Figure 4: Some polular IDEs The main features of the IDE:
- Convenience for modifying existing code: it helps to adapt the code available on the Internet, thereby creating a new piece of code that can run well based on individual needs.
- Syntax Autofill: Helps solve problems like remembering the syntax in a statement. These syntaxes will vary depending on the programming language used.
- Error detection: IDEs also have a built-in error highlighting feature to help programmers detect errors more quickly.
- Support test run the code: Integrating an additional window to check the program results will save a lot of time for programmers, instead of having to save the file and then launch it. Figure 5 : use of IDE 2 , IDE usage a, IDE used in my program Microsoft Visual Studio is an integrated development environment (IDE) from Microsoft. It can be used to develop console and graphical user interface applications along with Windows Forms applications, websites, web applications, and web services in both native codes together with managed code for all platforms supported by Microsoft. In other words, Microsoft Visual Studio is a specialized IDE used to develop Microsoft web applications, desktop programs, and mobile applications. Visual Studio has a code editor that supports intellisense (code completion). Besides being used to develop graphical user interface applications with Windows API, Windows Forms also supports 36 different languages. And the IDE that I used to create this STRAT Library application is Visual Studio Professional 2 022. Here are some features of Visual Studio 2022 I used in my program: Code editor Like other IDEs, Visual Studio 2022 includes a code editor that supports syntax highlighting and code completion using IntelliSense. In addition to using functions, variables, and methods, it also applies language constructs including control loops or queries. Based on this feature, Visual Studio 2022 knows my language syntax. Help highlight the syntax in the code with different colors like black, red, green, blue, pink…
Figure 8 : Example of debug Deginer Visual Studio 2022 help create "Window Form Design" which helps me to design "Graphical User Interface" (GUI. So, I designed interface for my START Library application here. Figure 9: Design
This IDE also supports other designers like WPF Designer, Web designer/development, Class designer, ... but I don't need to use it to design my application. b, Evaluation of IDE usage Visual Studio 2022 makes it easier and more convenient for programmers to develop applications and software products. Without an IDE, programmers can still write source code, because to run the source code of a programming language, only the corresponding compiler of that language is needed. However, the lack of an IDE makes writing source code complicated, time-consuming, and even inefficient for large programs with complex structures. For me, the Visual Studio 20 22 has helped a lot in the programming process, especially in the design process of the STRAT Library application. From the process of designing the interface for the application to be beautiful, easy to see and understand with ToolBox (dataGirdView, Button, ListBox, GroupBox) to writing code. Here are the strengths and weaknesses of this IDE: Advantages of Visual Studio 2022:
- Visual Studio interface is easy to use for beginners like me: data presentation controls like Label, Button, ListBox, … are easy to operate and use. In general, the design has become more flexible.
- This IDE has helped me write code, and they are packed with a lot of features to make coding simpler.
- Syntax autofill has helped me save time and not crash when entering syntax in statements or repeating commands.
- The syntax highlighting feature in the code directs me to the purpose of making the code in the program easily distinguishable. Thanks to that, I can use the correct commands and syntax and get a nicer, more understandable view.
- Automation tool, error list, enable debugging while programming the application. This helps me solve logic errors during programming, saving me time to find errors. IV. Program results 1, Activity Diagram
Figure 1 Figure :Activity diagram of Buton Edit Figure :Activity diagram of Buton Delete
Figure :Activity diagram of cellclick
Figure :Activity diagram of Buton buy
2. Explaination a, Design This application is implemented for the purpose of managing a book store. This is the design of the interface.
Figure 10 : Design form (tab add new book) Figure 21 : Design Form (tab Manage book