Docsity

COMPPUTER LANGUAGE ASSINGMENT 1618, Lecture notes of Programming Languages

Toggle sidebar
bg1
Higher Nationals in Computing
PROGRAMMING
ASSIGNMENT
No.2/2
Learner’s name: Bui Minh Hoang
Assessor name: Nam Lam
Class:
Learner’s ID: GCS210950
Subject’s ID:
Assignment due:
Assignment submitted: 10/3
1 | P a g e
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19

Partial preview of the text

Download COMPPUTER LANGUAGE ASSINGMENT 1618 and more Lecture notes Programming Languages in PDF only on Docsity!

Higher Nationals in Computing

PROGRAMMING

ASSIGNMENT

No.2/

Learner’s name: Bui Minh Hoang Assessor name: Nam Lam Class: Learner’s ID: GCS Subject’s ID: Assignment due: Assignment submitted: 10/

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 Bui Minh Hoang Student ID GCS

Class 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

P1 M1 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.

mission

 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.

 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.

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

organizations 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

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.

2. Customers should be able to reserve a ticket for any scheduled flight. Customers can also build a

multi-flight itinerary.

3. Users of the system can check flight schedules, their departure time, available seats, arrival time,

and other flight details.

4. 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.

Learning Outcomes and Assessment Criteria (Assignment 2):

Learning

Outcome

Pass Merit Distinction

LO2 P2 Give explanations of what

procedural, object-oriented

and event-driven paradigms

are; their characteristics and

the relationship between them.

M2 Analyse the

common features that a

developer has access to

in an IDE.

D2 Critically evaluate the

source code of an application

which implements the

programming paradigms, in

terms of the code structure and

characteristics.

LO3 P3 Write a program that

implements an algorithm

using an IDE.

M3 Use the IDE to

manage the

development process of

the program.

D3 Evaluate the use of an IDE

for development of applications

contrasted with not using an

IDE.

LO4 P4 Explain the debugging

process and explain the

debugging facilities available

in the IDE.

P5 Outline the coding

standard you have used in

your code.

M4 Evaluate how the

debugging process can

be used to help develop

more secure, robust

applications.

D4 Critically evaluate why a

coding standard is necessary in

a team as well as for the

individual.

Table of contents Assignment Brief 2 (RQF)............................................................................................................................................ 2 Higher National Certificate/Diploma in Computing................................................................................................. 2 P1. Introduction to your program............................................................................................................................. 12

  1. Overview of the problem:.................................................................................................................................. 12
  2. List of user requirement:.................................................................................................................................... 12 P2. Explain programming paradigms..................................................................................................................... 12
  3. Procedural Programming:.................................................................................................................................. 12
  4. Characteristics of procedural programming:...................................................................................................... 12 Predefined functions. In a program, a function is a procedure that may be invoked by its name. Built-in functions refer to predefined functions. They are a collection of subroutines that perform specialized functions.............. 12 Local variables. A local variable is a variable with local scope in computer science. The same variable name in the broader scope is overridden by local variable references in the function or block in which it is defined.... 13 Global variables. A global variable in computer programming is a variable having global scope, which means it is visible (and hence accessible) throughout the program unless shadowed..................................................... 13
  5. Object-orient programming (OOP):.................................................................................................................... 13 Object Oriented Programming (OOP) is a programming paradigm that uses classes and objects. It's utilized to break down a software program into reusable code blueprints (called classes) that may be used to build specific instances of things................................................................................................................................................. 13 Class declaration – here is the line in which the class name is declared............................................................... 13 Class body — classes have a single class body, analogous to the method idioms in the language. It's wrapped in curly braces "{" and "}" and defined directly after the class definition. The text between the brackets is referred to as the class's body............................................................................................................................................. 13

Debugger: Debugging tools aid users in locating and correcting mistakes in source code. To evaluate functionality and performance, they frequently imitate real-world scenarios. Before an application is deployed, programmers and software engineers may generally test the various portions of code and detect issues.......... 14 Compilers: are components that convert programming languages into machine-readable formats, such as binary code. To guarantee that the machine code is accurate, it is examined. After that, the compiler parses and optimizes the code to improve performance......................................................................................................... 14 ............................................................................................................................................................................... 15 How to use and debug in Visual Studio:................................................................................................................. 15 Step 1: Create a project:........................................................................................................................................ 15 ............................................................................................................................................................................... 15

  1. Open VScode...................................................................................................................................................... 15 2 chose Create a new project................................................................................................................................. 15 ............................................................................................................................................................................... 16 There are various programing language you can chose, for me I chose C# and press next to make some procedure to finish create a new project............................................................................................................... 16 After that you will start to write your program and debug it................................................................................. 16 Step 1: Create a break-point.................................................................................................................................. 16 ............................................................................................................................................................................... 16 Step 2: Run the program under debugging mode (by press F5)............................................................................. 17 The program will at the break-point and will show out the panel for you to check the variable’s value............... 17 ............................................................................................................................................................................... 17 Step 3: Debug the program line by line, Step-over................................................................................................ 17 There are two mode: step-into(F11) and step-over(F10)....................................................................................... 17 ............................................................................................................................................................................... 17 Explain:.................................................................................................................................................................. 18 When I step over, I have input 1 into the program, now the choice in the panel value is “1”............................... 18 Step 5: Keep step over to next line:....................................................................................................................... 18 ............................................................................................................................................................................... 18 Now you can see the program lead us to case 1.................................................................................................... 18 Sum up: the program had run correctly with input 1............................................................................................. 18

That is all simple step to debug your program, it will be a bit different if there a bug, but basically that all you have to know when debug program...................................................................................................................... 18 P4. Design and Implementation................................................................................................................................. 18

  1. Flow chart of the program................................................................................................................................. 18 ............................................................................................................................................................................... 19
  2. Final result:........................................................................................................................................................ 19 The menu............................................................................................................................................................... 19 ............................................................................................................................................................................... 19 There will be six action user can choice to make the program run........................................................................ 19 Choice 1................................................................................................................................................................. 19 ............................................................................................................................................................................... 20 The program will allow you to enter user information.......................................................................................... 20 Choice 2................................................................................................................................................................. 20 ............................................................................................................................................................................... 20 The program will allow you to enter book information......................................................................................... 20 Choice 3................................................................................................................................................................. 20 ............................................................................................................................................................................... 20 The Program will show out the list of user............................................................................................................. 20 Choice 4................................................................................................................................................................. 20 ............................................................................................................................................................................... 21 The program will show out the list of books.......................................................................................................... 21 Choice 5................................................................................................................................................................. 21 The program will let you choice a book you want to borrow and delete it out of the book list............................ 21 Choice 6................................................................................................................................................................. 21 The program will be exit as soon as you press 6.................................................................................................... 21
  3. Source code........................................................................................................................................................ 21 ............................................................................................................................................................................... 21 Source code input, output book information......................................................................................................... 21 ............................................................................................................................................................................... 22 Source code input, output user information.......................................................................................................... 22
  • The switch case function........................................................................................................................................
    1. Coding Standards...............................................................................................................................................
  • elements:............................................................................................................................................................... that program's code. Each project has its own set of requirements. A Coding Standard consists of the following
  • Determining the names of variables, constants, functions, classes, and so on......................................................
  • To make the program easy to implement..............................................................................................................
  • Tab, whitespace.....................................................................................................................................................
  • Make the program more seeable and easier to fix................................................................................................
  • Declare variables and utilize them.........................................................................................................................
  • Make the code be more simplify...........................................................................................................................
  • Leave a comment...................................................................................................................................................
  • Help the next programmer know what to do which your program.......................................................................
  • Reference material:...................................................................................................................................................
  • P1. Introduction to your program........................................................................................
      1. Overview of the problem:.............................................................................................
      1. List of user requirement:...............................................................................................
    • P2. Explain programming paradigms...............................................................................
      1. Procedural Programming:.............................................................................................
      1. Characteristics of procedural programming:................................................................
      1. Object-orient programming (OOP):..............................................................................
      1. Characteristics of OOP:................................................................................................
      1. Paradigms use to develop my program.........................................................................
  • P3. IDE feature....................................................................................................................
      1. What is IDE...................................................................................................................
      1. Introduce features and how to use IDE with illustrations.............................................
    • How to use and debug in Visual Studio:...........................................................................
  • P4. Design and Implementation........................................................................................
      1. Flow chart of the program...........................................................................................
      1. Final result:.................................................................................................................
      1. Source code.................................................................................................................
      1. Coding Standards........................................................................................................
  •  Reference material:........................................................................................................

P1. Introduction to your program.

1. Overview of the problem:

There are a lot of paradigms for programming such as procedural, object-oriented (OOP

for short) …. So, whether I step in to analyze the problem I need to solve, beside using the

paradigms to make the program more usable is not easy. I will demonstrate the way that I

solve the library management problem. First, I create a list of user requirement to make it

easier to manage what I was doing. Next, is choosing the paradigms I will use in my

program and how it helps me to solve the problem.

2. List of user requirement:

 Enter book’s name, author, id.

 Enter user’ name, id.

 Show all the book availed to borrow.

 Borrow a book.

I will solve this problem by making a small application which can response all the

requirement.

P2. Explain programming paradigms.

1. Procedural Programming:

Procedural programming language based on the notion that programs are made up of a series of

instructions that must be followed in order to be executed. They focus strongly on breaking down

programs into named sets of instructions known as procedures, which are similar to functions.

In procedural programming, there are two types of data: local and global. Data that is

contained within a function is referred to as local data, whereas data that is not included within any

function is referred to as global data. Only the function that defines local data has access to it. As a

consequence, each function has both local and global data at its disposal.

COBOL, FORTRAN, C, and Pascal are some of the computer languages that may support procedural

programming for both local and global data.

2. Characteristics of procedural programming:

 Predefined functions. In a program, a function is a procedure that may be

invoked by its name. Built-in functions refer to predefined functions. They are a

collection of subroutines that perform specialized functions.

for a beginner like me. It will help me much in separate the program to small application make me more

easy to code. Simply defined, procedural programming is laying down a series of instructions that teach

the computer how to complete a task step by step.

P3. IDE feature.

1. What is IDE

An integrated development environment (IDE) is a software application that gives computer programmers

all the tools they need to create software. A source code editor, build automation tools, and a debugger are

usually included in an IDE. Some IDEs, like NetBeans and Eclipse, have the required compiler,

interpreter, or both; others, like SharpDevelop and Lazarus, don't.

The line between an IDE and the rest of the software development environment isn't always clear; some

IDEs include a version control system or other tools to make building a graphical user interface (GUI)

easier. For object-oriented software development, many current IDEs include a class browser, an object

browser, and a class hierarchy diagram.

2. Introduce features and how to use IDE with illustrations

I will use Visual Studio to create this application.

Some VS2019 feature:

 Text editor: Almost every IDE includes a text editor for writing and manipulating source code.

Some programs offer visual components that allow you to drag and drop front-end components,

but most have a basic interface with syntax highlighting for each language.

 Debugger: Debugging tools aid users in locating and correcting mistakes in source code. To

evaluate functionality and performance, they frequently imitate real-world scenarios. Before an

application is deployed, programmers and software engineers may generally test the various

portions of code and detect issues.

 Compilers: are components that convert programming languages into machine-readable formats,

such as binary code. To guarantee that the machine code is accurate, it is examined. After that, the

compiler parses and optimizes the code to improve performance.

How to use and debug in Visual Studio:

 Step 1: Create a project:

1. Open VScode

2 chose Create a new project

 Step 2: Run the program under debugging mode (by press F5)

The program will at the break-point and will show out the panel for you to check the variable’s

value

 Step 3: Debug the program line by line, Step-over

There are two mode: step-into(F11) and step-over(F10)

Explain:

When I step over, I have input 1 into the program, now the choice in the panel value is “1”

 Step 5: Keep step over to next line:

Now you can see the program lead us to case 1.

Sum up: the program had run correctly with input 1

That is all simple step to debug your program, it will be a bit different if there a bug, but basically that

all you have to know when debug program.

P4. Design and Implementation

1. Flow chart of the program