Docsity

Programming C# (1618) ASM2, Study Guides, Projects, Research of Programming Languages

Toggle sidebar
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
Phan Nhat Linh
Student ID
GCD201635
Class
GCD0905
Assessor name
Nguyen Van Loi
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
Linh
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

Partial preview of the text

Download Programming C# (1618) ASM2 and more Study Guides, Projects, Research 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 Phan Nhat Linh Student ID GCD Class GCD0905 Assessor name Nguyen Van Loi 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 Linh Grading grid P2 P3 P4 P5 M2 M3 M4 D2 D3 D

 Summative Feedback:  Resubmission Feedback:

Grade: Assessor Signature: Date: Lecturer Signature:

Table of Contents

  • CHAPTER I: INTRODUCTION
      1. Overview
      1. Context of the problem and list of user requirements
      1. How my application could solve the problem
  • CHAPTER II: EXPLAIN PROGRAMMING PARADIGMS
      1. Procedural Programming
      • 1.1 Definition
      • 1.2 Key Features
      1. Object-oriented Programming
      • 2.1 Definition
      • 2.2 Key Features
      1. Event-driven Programming
      • 3.1 Definition
      • 3.2 Key Features
      1. Explain why and how my program use Procedural paradigm
  • CHAPTER III: IDE FEATURES
    • I. What IDE is
      1. Visual Studio 2022 Community
      • 2.1 Common features
    • implementation 3. Explanation of the debugging process and Evidences used debugging during the
      1. Evaluation of the debugging process in visual studio
    • applications 5. Evaluate how the debugging process can be used to help develop more secure, robust
  • CHAPTER IV: DESIGN
      1. Design use case diagram of the program
      1. Design the flowchart of the program
  • CHAPTER V: IMPLEMENTATION
      1. Global variables
      1. Main function
      1. RoomStatus function
      1. RoomStatusAdditional function
  • CHAPTER V: CODING STANDARD IN THE PROGRAM
      1. Name convention
      1. Layout convention
      1. Evaluate coding standards used in the program
      1. The Advantages to organizations of using Coding Standard
  • References
  • Figure 1: Overview............................................................................................................................. Table of Figures
  • Figure 2: Example of Procedural Programming Paradigms
  • Figure 3: Example of Object-oriented Programming
  • Figure 4: Example of Event-driven Programming
  • Figure 5: Source code of Figure
  • Figure 6: Visual Studio is the most famous IDE
  • Figure 7:Logo of Visual Studio 2022 Community
  • Figure 8: Command hint
  • Figure 9: Syntax highlighting
  • Figure 10: Compiler
  • Figure 11: Solution explorer
  • Figure 12: Debug on toolbar
  • Figure 13: All buttons used to control the Debug process
  • Figure 14: Checking the program progress
  • Figure 15:Auto window
  • Figure 16: Watch window
  • Figure 17: Local window
  • Figure 18: Putting the breakpoint
  • Figure 19: Start button
  • Figure 20: Use case diagram of the program
  • Figure 21: The flowchart of the program
  • Figure 22: Global variables in the program
  • Figure 23: Main function (source code)
  • Figure 24: : Main function (Result)
  • Figure 25: The flowchart of Main function
  • Figure 26: RoomStatus function (Source code)
  • Figure 27: The flowchart of RoomStatus function
  • Figure 28: RoomstatusAdditional function (source code)
  • Figure 29: RoomstatusAdditional function (Result)
  • Figure 30: The flowchart of RoomStatusAdditional function
  • Figure 31: Auto cleanup code
  • Figure 32: Writing only one statement per line
  • Figure 33: Write only one declaration per line
  • Figure 34: Using comments to explain.

CHAPTER I: INTRODUCTION

1. Overview Figure 1 : Overview I passed the report 1 presentation to exhibit my core programming and problem-solving skills. The more difficult task of creating a fully functional application has now been given to me. I have applied for a post as a trainee with a software development company and have been invited for an interview. I have been passed the presentation to demonstrate your problem solving and basic programming skills. Now I am 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. 2. Context of the problem and list of user requirements 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.

Simply said, Procedural Programming is laying down a series of instructions that inform the computer what to do step-by-step to complete the task at hand. Figure 2 : Example of Procedural Programming Paradigms

1. 2 Key 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’.

2. Object-oriented Programming 2.1 Definition Object Oriented programming (OOP) is a programming paradigm that relies on the concept of classes and objects. It is used to structure a software program into simple, reusable pieces of code blueprints (usually called classes), which are used to create individual instances of objects. There are many object-oriented programming languages including JavaScript, C#, Java, and Python. A class is an abstract blueprint used to create more specific, concrete objects. Classes often represent broad categories, like Student and Teacher that share attributes. These classes define what attributes an instance of this type will have, like activity, but not the value of those attributes for a specific object. Classes can also contain functions, called methods available only to objects of that type. These functions are defined within the class and perform some action helpful to that specific type of object.

Polymorphism Takes any Shape: Object-oriented programming allows procedures about objects to be created whose exact type is not known until runtime. For example, a screen cursor may change its shape from an arrow to a line depending on the program mode. The routine to move the cursor on screen in response to mouse movement would be written for "cursor," and polymorphism allows that cursor to take on whatever shape is required at runtime. It also allows new shapes to be easily integrated.

3. Event-driven Programming 3.1 Definition In computer programming, event-driven programming is a programming paradigm in which the flow of the program is determined by events such as user actions (mouse clicks, key presses), sensor outputs, or messages from other programs or threads. Event-driven programming is the dominant paradigm used in graphical user interfaces and other applications (e.g., JavaScript web applications) that are centered on performing certain actions in response to user input. This is also true of programming for device drivers (e.g., P in USB device driver stacks). In an event- driven application, there is generally a main loop that listens for events, and then triggers a callback function when one of those events is detected. In embedded systems, the same may be achieved using hardware interrupts instead of a constantly running main loop. Event-driven programs can be written in any programming language, although the task is easier in languages that provide high-level abstractions, such as await and closures

Figure 4 : Example of Event-driven Programming Figure 5 : Source code of Figure 4 3.2 Key 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

CHAPTER III: IDE FEATURES I. What IDE is An integrated development environment (IDE) is a software application that provides comprehensive facilities to computer programmers for software development. An IDE normally consists of at least a source code editor, build automation tools, and a debugger. Figure 6 : Visual Studio is the most famous IDE Common IDEs being used include Visual Studio, Eclipse, Visual Studio Code, Android Studio. We will be utilizing Visual Studio in this project to complete the requirements that were presented in this course. So please allow me to provide you with a broad summary of the Visual Studio Community.

2. Visual Studio 20 22 Community Figure 7 :Logo of Visual Studio 2022 Community Microsoft's Visual Studio is an IDE used to create Graphical User Interface (GUI), console, web applications, web apps, mobile apps, cloud, and web services, among other things. With the aid of this IDE, you may generate both managed and native code. It makes use of Microsoft software development platforms such as Windows Store, Microsoft Silverlight, Windows API, and others. It is not a language-specific IDE because it can be used to write code in C#, C++, Python, and a variety of other languages. It supports a total of 36 distinct programming languages. 2.1 Common features a. Editing of code You can work with code more easily if you use the Visual Studio coding editor. It has various features that make creating and maintaining your application easier than it would be without.

Figure 10 : Compiler c. Solution explorer You may use Visual Studio's Solution Explorer window to investigate and manage your solutions and projects. When you launch Solution Explorer, it displays the projects that comprise your solution, as well as the files and folders in each project that are physically present on the physical hard disk, as well as any assemblies, COM objects, or files that the project references. The context menus offered in Solution Explorer provide a variety of commands that may be used to better manage your projects.

Figure 11 : Solution explorer

3. Explanation of the debugging process and Evidences used debugging during the implementation ➢ If you want to debug your entire program then you will have to perform a few steps: Step 1: You will have to select Debug on toolbar, then click on step over