ASM2_PROGRAMMING in greenwich VN, Assignments of Programming Languages

this is a document of programming subject

Typology: Assignments

2021/2022

Uploaded on 10/29/2022

truong-anh-tu-fgw-hn
truong-anh-tu-fgw-hn 🇻🇳

4.8

(4)

9 documents

1 / 49

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
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
TRUONG ANH TU
Student ID
GCH210167
Class
GCH1101
Assessor name
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
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a
pf1b
pf1c
pf1d
pf1e
pf1f
pf20
pf21
pf22
pf23
pf24
pf25
pf26
pf27
pf28
pf29
pf2a
pf2b
pf2c
pf2d
pf2e
pf2f
pf30
pf31

Partial preview of the text

Download ASM2_PROGRAMMING in greenwich VN and more Assignments Programming Languages 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 Date Received 1st submission Re-submission Date Date Received 2nd submission Student Name TRUONG ANH TU Student ID GCH Class GCH1101 Assessor name 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

 Summative Feedback:  Resubmission Feedback:

Grade: Assessor Signature: Date: Lecturer Signature:

Assignment Brief 2 (RQF)

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: Assignment scenario Scenario : You have applied for a post as a trainee with a software development company and have been invited for an interview. You have been passed the presentation to demonstrate your problem solving and basic programming skills. Now you are given a more challenge task to create a fully working, secure application that has been developed using an IDE and adheres to coding standards for a detailed business problem. Tasks You will discuss a suitable problem with your mentor and list the user requirements before designing, implementing (coding) and testing a solution. You will create a report that should include: ● Introduction to your program (list of requirements and screenshots of program) ● Explain some of programming paradigms. Evaluate why and how your program use these (or some of) paradigms. ● Explain the common features of an IDE should have and evidence of how the IDE was used to manage the development of your code. ● An evaluation of developing applications using an IDE versus developing an application without using an IDE. ● An explanation and evaluation of the debugging process in the IDE used and how it helped with development. ● An explanation and evaluation of coding standards used in your program and the benefits to organisations of using them. The working application produced must also be demonstrated together with the presentation. Case Studies You can choose one of following case studies to implement Hotel Management System: A Hotel Management System is a software built to handle all online hotel activities easily and safely. This System will give the hotel management power and flexibility to manage the entire system from a single online portal. The system allows the manager to keep track of all the available rooms in the system as well as to book rooms and generate bills.

  1. The system should support the booking of different room types like standard, deluxe, family suite, etc.
  1. Guests should be able to search the room inventory and book any available room.
  2. The system should be able to retrieve information, such as who booked a particular room, or what rooms were booked by a specific customer. 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.
  3. Any library member should be able to search books by their title, author, subject category as well by the publication date.
  4. 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.
  5. 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. E- ticketing systems allow customers to browse through movies currently playing and book seats, anywhere and anytime.
  6. Each cinema can have multiple halls and each hall can run one movie show at a time.
  7. Each Movie will have multiple shows.
  8. Customers should be able to search movies by their title, language, genre, release date, and city name.
  9. 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.
  10. Customers should be able to search for flights for a given date and source/destination airport.
  11. Customers should be able to reserve a ticket for any scheduled flight. Customers can also build a multi-flight itinerary.
  12. Users of the system can check flight schedules, their departure time, available seats, arrival time, and other flight details.
  13. 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).
    1. How IDE helps developer?
    1. Using debugging during the implementation
    1. Developing an application with and without IDE
  • IV) DESIGN AND IMPLEMENTATION
      1. Flowchart:
      • a) User case:....................................................................................................................................................................................
      • b) User – SignUp(SignIn) account:
      • c) User – Renting books..............................................................................................................................................................
      • d) Admin – Adding Books and Seaching-and-Updating book’s data...........................................................................
      • e) Admin – Deleting user account:
      1. Source code and the final application:
      • a) Source code:
      • b) Library:
      • c) Data types and variables
      • d) Final application:......................................................................................................................................................................
      • e) Coding Stardards
      • f) Benefits of using coding stardards......................................................................................................................................

INTRODUCTION After passing the interview, I was tasked with creating a fully functional application, which was one of the five applications required by the scenario. I have finished coding and here will be my presentation, I will divide my work into 4 chapters:

  • Chapter 1: Introduction to the program
  • Chapter 2: Explain programming paradigms
  • Chapter 3: IDE features
  • Chapter 4: Design and implementation I) INTRODUCTION TO THE PROGRAM
  1. Overview the problem:
  • After reading and understanding, I chose the topic that I feel most suitable for me, which is the library management system. ( 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.
  • Any library member should be able to search books by their title, author, subject category as well by the publication date.
  • Simply put, Procedural Programming involves writing down a list of instructions to tell the computer what it should do step-by-step to finish the task at hand. b) Features
  • Predefined functions: A predefined function is typically an instruction identified by a name. Usually, the predefined functions are built into higher-level programming languages, but they are derived from the library or the registry, rather than the program. One example of a pre-defined function is ‘charAt()’, which searches for a character position in a string.
  • Local Variable: A local variable is a variable that is declared in the main structure of a method and is limited to the local scope it is given. The local variable can only be used in the method it is defined in, and if it were to be used outside the defined method, the code will cease to work
  • Global Variable: A global variable is a variable which is declared outside every other function defined in the code. Due to this, global variables can be used in all functions, unlike a local variable.
  • Modularity: Modularity is when two dissimilar systems have two different tasks at hand but are grouped together to conclude a larger task first. Every group of systems then would have its own tasks finished one after the other until all tasks are complete.
  • Parameter Passing: Parameter Passing is a mechanism used to pass parameters to functions, subroutines or procedures. Parameter Passing can be done through ‘pass by value’, ‘pass by reference’, ‘pass by result’, ‘pass by value-result’ and ‘pass by the name’.

• ADVANTAGES AND DISADVANTAGES

  • Advantages ➢ Adopted by many general-purpose programming languages. ➢ Enhances the reusability of the code. ➢ Makes the Implementation of algorithms easy. ➢ Simplifies the code and makes it easy to understand. ➢ Tracking the program flow is easy as the same flow linearly.
  • Disadvantages ➢ Data is vulnerable. ➢ Not much practical for solving real-world problems. ➢ Programs created using this programming paradigm are complex. c) Illustates (Images from my application) *Source code: public static void EnableTab(TabPage page, bool enable) { foreach (Control ctl in page.Controls) ctl.Enabled = enable; } *Explaination:
    • The above function has the function to pass the state of a tabpage to the user who can use it or not. In the program, whenever I want to block a certain tabpage, I just call this function as EnableTab(tabpage1,flase).
  1. Object-oriented programming a) Define:
  • OOP is an object-oriented programming technique that combines data and instructions for processing that data into an object that can be used within the program. Object-oriented programming provides concepts that help modelling complicated systems of real world into manageable software solutions.
  • Advantages and Disadvantages
  • Advantages: ➢ OOP is easy to maintain because of its modularity and encapsulation. ➢ OOP simulates the real world,making it simpler to comprehend. ➢ Because objects are complete in and of themselves,they may be reused in other applications.
  • Disadvantages:
  • Source code: public class BorrowingBooks { public string From { get; set; } public string To { get; set; } public string Name { get; set; } public string Year { get; set; } public string Publisher { get; set; } public string Author { get; set; } public string Type { get; set; } public string Price { get; set; } public string NameOfRenter { get; set; } }
  • Explaination: when i want to declare a list and they have a lot of information like name, category, price... then i have to have a class to be able to group them at to describe an object
  1. Event-Driven Programming a) Define
  • Event-driven programming is a programming paradigm in which program execution is determined by new user events (mouse clicks, keypresses), sensor outputs, or message passing from other programs. Programmers use Event-driven programming in graphical user interfaces and other applications that focus on performing user actions in response to user input (user clicks).
  • We can also define event-driven programming as a way of building a computer program, in which, in the essential function of the program, the main event loop of the application is explicitly highlighted in the code, the body of which consists of two parts: fetching the event and event handling. In an event-driven application, the main loop listens for events and triggers a callback function when one of those events is detected. b) Features
  • Service-Oriented: Service-focused is a key feature in event-driven programming used to create programs created for services, and it does not slow down the computer. The service-oriented only take in little of the computer control vitality, and usually, services run in the backdrop of OS.
  • Time-Driven: In motivated event programming, time influenced is a paradigm. From the code that runs on a period trigger, time motivated can be considered a specific code that works in a particular time, which could be once one hour, once a week, or once a month. This means from the pre-set to do the activity. For example, house windows revise is the exemplary case of time motivated, which individual can establish when to revise or when to check and download the revise.
  • Trigger Functions: Trigger functions in event-driven coding are functions that decide on what code to perform whenever there is a specific event occurs. Programmers use these functions to select which event handler to use for the function when you can find specific event occurred.
  • Events: Events include mouse, computer keyboard, and user interface, which events have to be triggered in this program. This means the user has to interact with an object in this program, for example, click a button by a mouse, use the computer keyboard to choose a button, etc.
  • The Simplicity of Programming and Ease of Development: Event-driven programming is simple and much more straightforward to program than another kind of programming as it's very aesthetic. For example, you can place a button by selecting it and place it onto a form and write a code for this. Event-driven development is also easy for the user to place a pre-written code script into an existing application. It allows the user to pause the code while running. Which makes expanding using event-driven programming is easy. c) Illustates (image from my application)
  • Source code: private void btnAdd_Click(object sender, EventArgs e) { CharacteristicBook list = new CharacteristicBook(); { list.Name = tbName.Text; list.Author = tbAuthor.Text; list.Year = tbYear.Text; list.Type = cbType.Text; list.Publisher = tbPublisher.Text; list.Price = tbPrice.Text; } Books.Add(list); BindingSource source = new BindingSource(); source.DataSource = Books; dtgHienThi.DataSource = source;
  1. Features of an IDE
  • IDEs increase programmer productivity by combining common activities of writing software into as ingle application: editing source code, building executables, and debugging.
    • Editing Source Code: writing code is an important part of programming.We start withablank file,writeafew lines of code, andaprogram is born! IDEs facilitate this process with features like syntax highlighting and autocomplete. ✓ Syntax Highlighting: an IDE that knows the syntax of your language can provide visual cues. Keywords, words that have special meaning like class in Java, are highlighted with different colors. Syntax highlighting makes code easier to read by visually clarifying different elements of language syntax. ✓ Example: ✓ Autocomplete: when the IDE knows your programming language, it can anticipate what you’re going to type next! ✓ Example:
    • Building Executables ✓ Java is a compiled language. Before programs run, the source code of a .java file must be transformed into an executable .class by the compiler. Once compiled, the program can be run from the terminal.

✓ This compilation process is necessary for every program, so why not have the IDE do it for us? IDEs provide automated build processes for languages, so the act of compiling and executing code is abstracted away, like in Codecademy lessons.

  • Debugging ✓ No programmer avoids writing bugs and programs with errors. ✓ When a program does not run correctly, IDEs provide debugging tools that allow programmers to examine different variables and inspect their code in a deliberate way. ✓ IDEs also provide hints while coding to prevent errors before compilation. ✓ Example:
  1. How IDE helps developer?
  • A good IDE will have a graphical debugger, so instead of having to remember line numbers etc to put breaks on, or the names of variables to watch; you can click on the lines you want to on, and click on the variables to watch. Essentially an easy to use point and click interface, is far easier to use than a command line interface.
  • A good IDE will enable you to also see the context for some code - you can scroll up and down and even look at other source code segments in other files, in order to understand how the code being debugged is called and what it will call next. More information you have, and the easier it is to get that information the easier the process will be.
  • Intelligent code completion : Intelligent code completion : is a context- Just a few of popular text editors support aware code completion feature in intelligent code completion feature. programming environments that help programmers speed up the process of coding by reducing typos and other common mistakes. This feature is carried out through auto completion popups when typing, querying parameters of functions, query hints related to syntax errors, variable names, functions and methods. Just a few of popular text editors support intelligent code completion feature. IV) DESIGN AND IMPLEMENTATION Screnario: Library Management System
  1. Flowchart: a) User case:

b) User – SignUp(SignIn) account:

  • Sign up Step 1: open signup tab Step 2: Input information Step 3: Add those information to account-List Step 4: Messagebox shows successfully
  • Sign In: Step 1: Open sign in tab Step 2: Input Username and password Step 3: For loop
  • if (Username = People[i].Username and Password = People[i].Password), then successfully
  • if it’s false, back to Step 2