





















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 Date Received 1st submission Re-submission Date Date Received 2nd submission Student Name Há» Ngá»c KhĂĄnh Student ID GCS Class GCD0901 Assessor name HoĂ ng Như VÄ©nh 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 Khanh Grading grid P2 P3 P4 P5 M2 M3 M4 D2 D3 D
Grade: Assessor Signature: Date: Lecturer Signature:
In the first report, I have already mentioned about a business problem of taking customerâs orders and built a small application with menu-based program to meet the requirements. Besides, in this report, I planned on creating an application which will manage the flight tickets from a specific airport. This problem might be intimidating because the problem involves plentiful elements going with hard requests. However, I still managed to create a full application.
The application has 5 classes in total, one of them is the main program and the rest are supporting for the main program. It will have eight options including:
Figure 3 : SUB FUNCTIONS
2. OOP (Object-Oriented Programming) DEFINITION: Object-oriented programming (OOP) is a method of computer programming or software design in which programmers specify the data type of a data structure as well as the operations or functions that can be performed on the data structure. Figure 4 : OBJECT-ORIENTED PROGRAMMING (LYNDA.COM) OOP CONCEPTS: - Class: A class of objects. The class describes all of the shared properties of the objects that belong to it. - Object: a self-contained body made up of both data and processes for manipulating the data. - Encapsulation involves treating a set of associated processes, properties and other representatives as a single entity. - Inheritance is the ability to receive âinheritâ methods and properties from an existing class.
3. Event-Driven Programming DEFINITION: Event-driven programming is a model of programming in which an event determines the flow of program execution - for example, a user action such as a mouse click or a key button or an operating system notification or other program code. Figure 8 : EVENT-DRIVEN PROGRAMMING ALONG WITH OOP (TECHNOLOGYUK.COM) KEY FEATURES: - Service Oriented: is a core aspect of event-driven programming used to produce services' programming. - Time Driven: In case of programming with motivation, time is influenced by the code that works on a triggering cycle. Motivated time can be regarded as a particular code working at a particular time. - Event Handlers: are a category of function or process that performs a particular event. - Trigger Functions: Event-driven coding uses trigger functions to trigger code when a specific event occurs. Trigger functions decide what code to perform when an event occurs. - Events: Events include mouse, computer keyboard and user interface, which events have to be triggered in this program in order to happen. - Simplicity of Programming and Ease of Development: Since it is rather aesthetic, event-driven programming is easy and much simpler to program than other types of programming. Event- driven architecture also allows users to easily insert pre-written programming scripts into current applications. - Compare Event Driven Programming with Object-oriented Programming (OOP): Event-driven coding is a computer programming framework that uses the occurrence of events to search for the program's control source, while objects-oriented encoding (OOP) treats datafields as entities that can only be accessed by pre-defined methods and it generated over four main rules, which are Encapsulation, Data Abstraction, Polymorphism, and Inheritance.
For the problem of creating an application earlier in the introduction, I decided to choose Object- oriented Programming as the Programming paradigm. It allows me to create new objects to assist me to build the program easily. Since the Event Driven Programming is genuinely new for me, I donât have any experience of building a full application hence I found it hard to work with it since it definitely takes more efforts and time to build a whole application. I also didnât choose Procedural Programming as my applicationâs paradigm since it will be a pain to maintain the quality or double-check the whole program at once.
Integrated Development Environment is a software application that offers robust software creation facilities to computer programmers. An integrated development environment (IDE) usually includes a source code editor, construct automation tools, and a debugger. Intelligent code completion is available in the majority of current IDEs. Some IDEs have either a compiler or an interpreter, or both.
4. Debugging During Implementation Since debugging tools are really that powerful and useful. With the help form them, I can easily find bugs and glitches without having to observe carefully for every line of code. Also, with object-orientetd programming, the helpfulness of the debugger really stood out in some situation. Figure 15 : DEBUGGING DURING IMPLEMENTATION In short, debugging tools of Visual Studio Community has helped me a lot during the programming process and the implementation. It shows the real time value of some variables, it executes by tapping F10 to check on every line of code.
Figure 16 : SCREENSHOT OF DEBUGGING
5. With IDE and Without IDE WITH IDE WITHOUT IDE ADV
â Can quickly navigate to type forward without having to care about libraries or namespaces â Helpful code automatic completion â Show errors right where the spot weâre typing â Show tips of how to solve the errors or typos â Helpful debugging tools â The format of showing compiler and file reader is user-friendly â We can be independent from the auto completion and debugging tools DISADVANTAGES â IDEs are complicated tools, so to master and use all of their tools takes time and patience â We can be dependent on them because of how helpful they are â Coding process might be more challenging and time-consuming â Takes more time to format Table 1 : THE DIFFERENCE OF USING IDE AND WITHOUT USING IDE
Console.ReadLine(); break; case Request.SearchTicket: Screen.DisplaySearchMenu(); byte searchRequest = Byte.Parse(Console.ReadLine()); switch (searchRequest) { case Request.SearchName: var searchName = Screen.EnterPassengerName(); plane.SearchTicket(searchName); Console.ReadLine(); break; case Request.SearchDate: var searchDate = Screen.EnterFlightDate(); plane.SearchFlightDate(searchDate); Console.ReadLine(); break; case Request.SearchDestination: var searchDestination = Screen.EnterDestination(); plane.SearchFlightDestination(searchDestination); Console.ReadLine(); break; default: Screen.DisplayInvalidOption(); break; } break; case Request.PrintTickets: plane.PrintListOfTicket(); Console.ReadLine(); break; case Request.Exit: return; break; default: Screen.DisplayInvalidOption(); break; } } while (order != 6 ); Console.ReadLine(); } } Figure 17 : CLASS: PROGRAM
class FlightTicket { public string FullName; public string Gender; public byte Age; public string FlightDate; public string Destination; public FlightTicket(string fullName, string gender, byte age, string flightDate, string dest ination) { FullName = fullName; Gender = gender; Age = age; FlightDate = flightDate; Destination = destination; } public string DisplayTicket() { string result = "==================================\n" + $"FULL NAME: {FullName} \n" + $"GENDER: {Gender} \n" + $"AGE: {Age} \n" + $"FLIGHT DATE: {FlightDate} \n" + $"DESTINATION: {Destination}\n" + "==================================\n"; return result; } Figure 18 : CLASS: FLIGHTTICKET class Plane { public string PlaneCode; public List