





























Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
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 1: Programming Submission date 29/03/2024 Date Received 1st submission 29/03/ Re-submission Date Date Received 2nd submission Student Name NGUYEN LE THANH CONG Student ID BS Class SE07102 Assessor name TRUONG QUOC KHANH 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 Cong Grading grid P3 P4 P5 P6 M2 M3 M4 D2 D3 D
❒ Summative Feedback: ❒ Resubmission Feedback: Grade: Assessor Signature: Date:
In this essay, I will show my project about calculating bill water application that was produced using the IDE and was subject to Coding standards for a comprehensive business problem. As a result, I have to write a WinForm application in the C# programming language of Microsoft Visual Studio. I also introduce to three programming paradigms: Procedural Programming, Object Orientated Programming, Event Driven Programming.
Procedural programming is a way of telling a computer what to do by giving it a list of instructions. These instructions a grouped together into smaller tasks called procedures. Procedural programming completes the task into step by step instructions. This style of programming is focused on the steps themselves, rather than on the date the program works with. It’s a good way to code for simpler tasks but this way couldn’t be suitable for complex tasks.
Instead of following a step by step instructions, event-driven programming lets programs respond to things happening around them. These "things" are called events, and they can come from various sources: Users interacting with the program (clicks, swipes, key presses) Sensors in the environment Other programs sending messages The network (data arriving or being sent)
The program constantly listens for these events, and when one happens, it triggers a specific piece of code designed to handle that situation. This makes event-driven programming useful for programs that need to be flexible and react to unexpected changes. EDP is particularly useful for programs that need to handle many things at once, or that need to react to unpredictable events from the outside world. For example, user interfaces, video games, and network servers all heavily rely on event-driven programming.
Instead of just telling the computer what to do step-by-step (like a recipe), Object- oriented programming (OOP) lets you organize programs around real-world things. These things are called objects, and they bundle together data (like what they are and their properties) and instructions (what they can do). This makes OOP easier to understand and manage, especially for big and complex programs. OOP has 4 basic properties: Encapsulation Abstraction Inheritance Polymorphism
(objects) that contain data (properties) and functionalities (methods) to operate on that data. objects. Objects are instances of classes and contain data and methods specific to that object. interact with each other through method calls. maintainabilit y for complex projects. EDP Focuses on how programs react to events (user interactions, sensor data, network activity) rather than following a rigid list of instructions. Code is structured around event listeners that wait for specific events and then execute corresponding code to handle those events. Control flow is event- driven, meaning it depends on the order and timing of events that the program encounters. Highly responsive to user input and external changes, ideal for user interfaces and network applications. Debugging event- driven programs can be challenging due to the asynchronous nature of events. Table 1 : Relationship between three programming paradigms
An IDE stands for Integrated Development Environment. It's basically a software application that combines a bunch of different tools that programmers use to write computer programs.
Source code editor: This is where programmers write their code. IDEs typically have features like syntax highlighting, which makes the code easier to read, and code completion, which can help programmers write code faster. Build automation tools: These tools help programmers automate the process of building their programs. This can save programmers a lot of time and effort. Debugger: This tool helps programmers find and fix errors in their code. There are also many other features that IDEs may have, such as version control integration, unit testing frameworks, and code profilers. IDEs can be used for a variety of programming languages, including Python, Java, C++, and web development languages like HTML, CSS, and JavaScript.
3.1. Definition: Debugging refers to the process of identifying and fixing errors, or bugs, in software. It's a vital part of software development to ensure the final product works as intended. Debugging involves finding and resolving issues that cause a program to malfunction, perform poorly, or generate incorrect results. These issues are often called bugs.
5. Fix the Error (Implement a Solution): Once you understand the root cause, you can fix the bug. This might involve correcting a syntax error, fixing a logical mistake in the code, or handling unexpected inputs differently. 6. Test the Fix: After implementing the fix, thoroughly test the program again. Verify that the error is resolved and no new issues are introduced. Sometimes, fixing one bug might uncover another, so it's important to retest comprehensively. 7. Document the Fix: It's good practice to document the bug, the solution implemented, and any relevant notes for future reference. This helps maintain the codebase and can be valuable for other developers working on the project.
The program was designed by a window form, in the context of Windows Forms development, is the foundation of a graphical user interface (GUI) for desktop applications. The visual application before enter Submit button:
Figure 1 : The visual application before enter Submit button The visual application after enter Submit button:
Figure 3 : Flowchart of program
3.1. Input, output of application: Input:
Customer have to choose their type for running the program Figure 5 : Have to choose type for running the program
In case of customer is household, they must enter number of people for running the program Figure 6 : Have to enter number of people in case of household customer