Docsity

ASM 2 1618: Programming, Essays (university) of Computer Programming

Toggle sidebar
bg1
Page | 1
Higher National in Computing
Unit 1: Programming
ASSIGNMENT 2
Name: Dong Sy Nhat Thanh
ID: GCS210033
Class: GCS1003A
Subject code: 1618
Assignment due: Assignment submitted:
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a
pf1b
pf1c
pf1d

Partial preview of the text

Download ASM 2 1618: Programming and more Essays (university) Computer Programming in PDF only on Docsity!

Higher National in Computing

Unit 1: Programming

ASSIGNMENT 2

Name: Dong Sy Nhat Thanh

ID: GCS

Class: GCS1003A

Subject code: 1618

Assignment due: Assignment submitted:

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 Dong Sy Nhat Thanh Student ID GCS Class Assessor name Nguyen Tuan Dang 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 D

Assignment Brief 2 (RQF)

Higher National Certificate/Diploma in Computing

Student Name/ID Number: Unit Number and Title: Unit 1: Programming Academic Year: 2021 – 2022 Unit Assessor: Vinh Hoang Assignment Title: Application development with IDE Issue Date: 10 September 2021 Submission Date: Internal Verifier Name: 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 Tutor. ● The form of submission will be a soft copy posted on http://cms.greenwich.edu.vn/. ● Remember to convert the word file into PDF file before the submission on CMS. Note: ● The individual Assignment must be your own work, and not copied by or from another student. ● 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 understand and follow the guidelines to avoid plagiarism. Failure to comply this requirement will result in a failed assignment. Unit Learning Outcomes: LO2 Explain the characteristics of procedural, object-oriented and event-driven programming, conduct an analysis of a suitable Integrated Development Environment (IDE) LO3 Implement basic algorithms in code using an IDE LO4 Determine the debugging process and explain the importance of a coding standard Assignment Brief and Guidance:

Library Management System A Library Management System is a software built to handle the primary housekeeping functions of a library. Libraries rely on library management systems to manage asset collections as well as relationships with their members. Library management systems help libraries keep track of the books and their checkouts, as well as members’ subscriptions and profiles. Library management systems also involve maintaining the database for entering new books and recording books that have been borrowed with their respective due dates.

  1. Any library member should be able to search books by their title, author, subject category as well by the publication date.
  2. The system should be able to retrieve information like who took a particular book or what are the books checked-out by a specific library member.
  3. User can add books with its information such as: title, author, publication date, category etc and update it Movie Ticket Booking System An online movie ticket booking system facilitates the purchasing of movie tickets to its customers. Eticketing systems allow customers to browse through movies currently playing and book seats, anywhere and anytime.
  4. Each cinema can have multiple halls and each hall can run one movie show at a time.
  5. Each Movie will have multiple shows.
  6. Customers should be able to search movies by their title, language, genre, release date, and city name.
  7. The customer should be able to select a show at a particular cinema and book their tickets. Airline Management System An Airline Management System is a managerial software which targets to control all operations of an airline. Airlines provide transport services for their passengers. They carry or hire aircraft for this purpose. All operations of an airline company are controlled by their airline management system. This system involves the scheduling of flights, air ticket reservations, flight cancellations, customer support, and staff management. Daily flights updates can also be retrieved by using the system. 1. Customers should be able to search for flights for a given date and source/destination airport.
  8. Customers should be able to reserve a ticket for any scheduled flight. Customers can also build a multi-flight itinerary.
  9. Users of the system can check flight schedules, their departure time, available seats, arrival time, and other flight details.
  10. The admin of the system can add new aircrafts, flights, and flight schedules. Admin can cancel any pre-scheduled flight (all stakeholders will be notified). Restaurant Management System A Restaurant Management System is a software built to handle all restaurant activities in an easy and safe manner. This System will give the Restaurant management power and flexibility to manage the

entire system from a single portal. The system allows the manager to keep track of available tables in the system as well as the reservation of tables and bill generation.

  1. The waiter should be able to create an order for a table and add meals for each seat.
  2. Each meal can have multiple meal items. Each meal item corresponds to a menu item.
  3. The system should be able to retrieve information about tables currently available to seat walk- in customers.
  4. The system should support the reservation of tables.

Table of Contents

  • Task 2 – Explain programming paradigms (P2)
      1. Procedural paradigm
    • 1.1 Introduction to computer programming language.
    • 1.2 Characteristics of procedural programming
      1. Object-oriented paradigm...................................................................................................................
    • 2.1 Definition of object-oriented programming
    • 2.2 What are the characteristics of object-oriented programming languages?
      1. Event-driven paradigm........................................................................................................................
    • 3.1 Definition of Event-driven paradigm.................................................................................................
    • 3.2 Characteristic of Event-driven paradigm
        1. Relationship between Object-oriented and Event-driven paradigm
  • Task 1 – Introduction to your program (P3)
      1. Explain my code
          1. Result..................................................................................................................................................
  • Task 3 – IDE features (P4)
      1. Debugging process
    • 1.1. Definition..........................................................................................................................................
    • 1.2. Description
      1. Explain the debugging facilities available in the IDE
    • 2.1. Debugging in IDE
    • 2.2. Debugging tools
  • Task 4 – Design and Implementation (P5)
      1. Rule of brackets...................................................................................................................................
      1. Tab, whitespace
      1. Comment.............................................................................................................................................
    • Appendix
    • References

Assignment 2

Task 2 – Explain programming paradigms (P2)

  1. Procedural paradigm:
  2. 1 Introduction to computer programming language. A programming language is a formal language that contains a set of generated instructions different output types. Programming languages are used in computer programming to implement algorithm. computer programming language, one of several languages that execute directly when referred to as a machine in a computer manufacturer-specific numerical form language, after a simple substitution process, when expressed in the appropriate assembly language or after translation from an "advanced" language. Programming languages are also divided into two types, which are "high-level" programming languages and "low-level" programming languages. 1.2 Characteristics of procedural programming. 3.1. Predefined function: is a predefined function in the library of the system you are using. Therefore, you can reuse the code in the system library 3.2 Libraries: In procedural programming, there are many libraries that contain functions and subroutines within them. Programmers can easily use those functions by declaring them first. 3.3 Local variables: A local variable is declared within an initialized method, block or method and it is limited to that one method. It only works within the method it's defined in, and it stops working when it's out of the scope of that method. 3.4 Global variables: Unlike local variables, global variables are declared outside of any defined methods, so they can be used by all functions. 3.5 Modularity: It is a popular programming concept that involves breaking down a program into subroutines, each of which has the necessary components to complete its work before being assembled into an executable application program.

Figure 1: My example flowchart 2.2 What are the characteristics of object-oriented programming languages? Class definitions– OOP's essential building elements and a single entity that integrates data and data operations. Object – instances of a class, including their variables and actions, that are employed in real- world functioning. Abstraction - Specifying what to do but not how to do it, a useful feature for gaining a comprehensive understanding of an object's capabilities. Encapsulation – a class attribute that unifies data and data operations into a single unit. Inheritance and class hierarchy - Reusability and extension of existing classes Polymorphism – Functions with the same name but different functionality, saves time by not having to invest in a large number of function names. Operator and function overloading

Generic classes – used to define data that isn't given. They're referred to as container classes. They're flexible and adaptable. Class libraries – Built-in language specific classes Message Passing – a feature that allows you to transmit and receive data between objects via function parameters.

  1. Event-driven paradigm: 3.1 Definition of Event-driven paradigm. Event-driven programming is a programming paradigm in which the flow of a program is governed by events such as user actions, sensor data, or messages from other programs or streams in computer programming. The prevalent programming paradigm in graphical user interfaces and other programs that focus on doing specific actions in response to user input is event-driven programming. The same is true when it comes to device driver programming. A main loop in an event-driven application normally listens for events and then fires a callback function when one of them is identified. Instead of a continually running main loop, hardware interrupts can be used in embedded systems to achieve the same result. Event-driven programs can be developed in any programming language, although languages with a high level of abstraction, such as await and closure, make the work easier. 3.2 Characteristic of Event-driven paradigm Service Oriented: It is a crucial aspect in event-driven programming that is used to design programs for services. It does not cause the computer to slow down because service-oriented programming uses less processing power and services are normally operated in the background of the operating system. Time Driven: It's a pattern, it's code that runs on a timer, and it may also be specific code that runs at a specific time, such as once an hour, once a week, or once a month, indicating that Time Driven is already set up to do the work. Event Handlers: It's a type of function or method that performs a specific action in response to a certain event. Consider the following scenario: When a user clicks on an event handler, it displays a message or launches a program, and when the user clicks on it again, it closes.

Task 1 – Introduction to your program (P3)

  1. Explain my code: ❖At first, I'll declare the product's price and serial number. These declaration lines can be seen in the image below. Every program requires a declaration because it works as a repository for the program's values. Figure 2 : Declare price and serial numbers After that, I added a few lines of code to allow the software to output the product's name and price, which may also be liked to think of as a menu. Figure 3 : Create Menu

❖Then I add further commands to the software so that it prints a few more lines for consumers to enter the serial number and quantity of the product they want to purchase. This is also the place for the program to receive information from the customer and start calculating and finally printing the price. Figure 4 : Enter serial number and quantity ❖ I also use a while statement to tell customers when they entered the wrong serial number. For example, the product I show here is 6, however if they type a number higher than 6, it will print "This product does not exist" and then show an additional line below it that says "re-enter here: ". Figure 5 : Error Message

❖ And finally, here is the code used to print the price Figure 7 : Output the price

  1. Result: In this part, I will divide it into 3 pictures to be able to show the different uses of the program. Here is the program when there is no discount: Figure 8 : No discount

And here is the program when it has a discount: Figure 9 : Has a discount And here is the program that notifies customers when they enter the wrong serial number: Figure 1 0 : Enter wrong serial number