You are on page 1of 27

ASSIGNMENT 1 FRONT SHEET

Qualification BTEC Level 5 HND Diploma in Computing

Unit number and title Unit 1: Programming

Submission date 20/12/2020 Date Received 1st submission 20/12/2020

Re-submission Date Date Received 2nd submission

Student Name Han Hong Son Student ID GCH190862

Class GCH0901 Assessor name Do Tien Thanh

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 son

Grading grid

P1 M1 D1

Page 1 of 27
 Summative Feedback:  Resubmission Feedback:

Grade: Assessor Signature: Date:


Lecturer Signature:

Page 2 of 27
Contents
I. Introduction:.................................................................................................................................................. 5
1. Define problem. ......................................................................................................................................... 5
II. Explanation of software development life cycle .............................................................................................. 6
1.Software Development Life Cycle (SDLC) mean? ........................................................................................ 6
2. Explains Software Development Life Cycle (SDLC) .................................................................................... 7
Step 1: Requirement collection and analysis (problem definition): ................................................................ 7
Step 2: Feasibility study: ............................................................................................................................ 7
Step 3: Design: .......................................................................................................................................... 7
Step 4: Coding:.......................................................................................................................................... 8
Step 5: Testing: ......................................................................................................................................... 8
Step 6: Installation/Deployment:................................................................................................................. 8
Step 7: Maintenance: ................................................................................................................................. 8
III. Solution. ..................................................................................................................................................... 9
1. Program Language:.................................................................................................................................... 9
2. Supporting Tool:........................................................................................................................................ 9
3. Component in C#. ...................................................................................................................................... 9
a) Data-type: ............................................................................................................................................. 9
b) Variables:.............................................................................................................................................. 9
c) Constant:............................................................................................................................................... 9
d) Expressions: .......................................................................................................................................... 9
4. Procedural programming. ......................................................................................................................... 10
5. List data types, data structures needed in the problem:................................................................................ 10
Conditional statements needed in the problem: .......................................................................................... 10
Loop statement needed in the problem: ..................................................................................................... 10
6. Hierarchy diagram for program................................................................................................................. 11
7. A use case diagram for actions required..................................................................................................... 12
8. Flowchart ................................................................................................................................................ 13
a) Checkage: ........................................................................................................................................... 13
b) Creat account ...................................................................................................................................... 14
c) Menu .................................................................................................................................................. 15

Page 3 of 27
IV. Implementation ......................................................................................................................................... 16
1. Operation Implementation ........................................................................................................................ 16
2. Start screen.............................................................................................................................................. 16
3. Enter age................................................................................................................................................. 17
4. Creat account .......................................................................................................................................... 18
5. Menu ...................................................................................................................................................... 21
V. Conclusion. ................................................................................................................................................ 26
VI. References ................................................................................................................................................ 27

Table of Figures
Figure 1 Steps in Program Development ............................................................................................................. 6
Figure 2 Hierarchy diagram ............................................................................................................................. 11
Figure 3 use case diagram ................................................................................................................................ 12
Figure 4 Flowchart of checkage ....................................................................................................................... 13
Figure 5 Flowchart of account.......................................................................................................................... 14
Figure 6 Flowchart of Menu ............................................................................................................................ 15

Page 4 of 27
I. Introduction:
I have applied for a post as a trainee with a software development company and have been invited for
an interview. I have been asked to demonstrate your problem solving and basic programming skills. To do
this I have to prepare a report on using algorithms to solve problems. I need to explain, using examples,
how algorithms are used to solve simple business problems and the steps needed to be followed to produce
a working program solution. I should make clear your assumption about your program. The problems to be
solved will involve basic procedural programming instructions - sequence instructions (input, output and
assignment statements), loops, conditional statements. Problems should be analysed and designed by the
use of flowchart and demonstrated by the use of modules (procedures) using a menu based program.
The company I received is a company specializing in high-end products. Currently the company lacks a
market for its products, so I decided to design an online sales application. The above app will target
customers aged 16 and over. On request, in my programming, I need to use:
• At least 1 if else, and 1 switch case, 1-2 for / while / do while
• (use 3 three structure) + at least one or two functions

1. Define problem.
My recruitment agency asked me to solve a corporate problem to prove my programming skills.
Accordingly, our company is one of the companies specializing in the production and trading of
entertainment products such as games, movies, music, ... Although the company's products ar e designed
very luxuriously. The output price is quite high but it is still well received by the public. However, the
company currently lacks a consumer market. So it asked me to create an online sales application using C#
to reach domestic and foreign customers. The app should have a nice introduction, a menu that's simple and
easy to use. Customers simply select products and make payment, the product information on the side of
the company will conduct editing if my program is approved.

Page 5 of 27
II. Explanation of software development life cycle

Figure 1 Steps in Program Development

1.Software Development Life Cycle (SDLC) mean?

A software development life cycle (SDLC) model is a calculated structure portraying all exercises in a
product improvement venture from planning to maintenance. This cycle is related with a few models, each
including an assortment of undertakings and exercises.[6]

Page 6 of 27
Software development is an awkward action requiring legitimate ID of necessities, their execution, and
programming sending. Nonetheless, the exercises don't end there. After the dispersion of the product,
legitimate upkeep must be given in a convenient way.

2. Explains Software Development Life Cycle (SDLC)


Let's look at a more intuitive way to approach the definition of the software development life cycle
(SDLC).Consider the stages that product improvement experiences, from the soonest explosions of a task
thought, to delivering that product live in a creation climate.
Think about the SDLC as made out of different "route stations" while in transit to full last turn of events
and delivery, with the entirety of the client testing and different things that go on toward the finish of the
cycle.
That is a decent method to begin pondering what the SDLC is.

Step 1: Requirement collection and analysis (problem definition):


The requirement is the first stage in the SDLC cycle. It is conducted by the senior colleagues with
contributions from all the partners and domain experts in the industry. Planning for the quality assurance
requirements and recognization of the risks involved is also done at this stage.[6]
This stage gives a more clear image of the extent of the whole undertaking and the foreseen issues,
opportunities, and directives which set off the task.
Requirements Gathering stage need groups to get point by point and exact necessities. This encourages
organizations to conclude the essential course of events to complete crafted by that framework.

Step 2: Feasibility study:


When the requirement analysis phase is finished the following SDLC step is to characterize and archive
programming needs. This cycle directed with the assistance of 'Software Requirement Specification' record
otherwise called 'SRS' document. It incorporates all that which should be planned and created during the
project life cycle.[6]

Step 3: Design:
In this third stage, the system and software configuration archives are set up according to the necessity
detail record. This characterizes by and large framework engineering.
This plan stage fills in as contribution for the following period of the model.
There are two sorts of configuration archives created in this stage:
High-Level Design (HLD):
• Brief description and name of each module
• An outline about the functionality of every module
• Interface relationship and dependencies between modules
• Database tables identified along with their key elements

Page 7 of 27
• Complete architecture diagrams along with technology details

Low-Level Design(LLD):
• Functional logic of the modules
• Database tables, which include type and size
• Complete detail of the interface
• Addresses all types of dependency issues
• Listing of error messages
• Complete input and outputs for every module[3]

Step 4: Coding:
When the system design stage is finished, the following stage is coding. In this stage, designers start
construct the whole system by composing code utilizing the picked programming language. In the coding
stage, errands are isolated into units or modules and allocated to the different designers . It is the longest
period of the Software Development Life Cycle measure. [3]
In this stage, Developer needs to follow certain predefined coding rules. They additionally need to utilize
programming apparatuses like compiler, mediators, debugger to produce and execute the code.

Step 5: Testing:
When the software is complete, and it is deployed in the testing climate. The testing group begins testing
the functionality of the whole system. This is done to check that the whole application works as indicated
by the client prerequisite.
During this stage, QA and testing group may discover a few bugs/surrenders which they convey to
designers. The advancement group fixes the bug and send back to QA for a re-test. This cycle proceeds until
the product is without bug, stable, and working as per the business needs of that framework.[3,6]

Step 6: Installation/Deployment:
When the software testing stage is finished and no bugs or blunders left in the framework then the final
deployment process begins. Based on the feedback given by the project manager, the last programming is
delivered and checked for arrangement issues assuming any.[3,4,6]

Step 7: Maintenance:
Once the system is deployed, and customers start using the developed system, following 3 activities
occur:
• Bug fixing - bugs are reported because of some scenarios which are not tested at all
• Upgrade - Upgrading the application to the newer versions of the Software

Page 8 of 27
• Enhancement - Adding some new features into the existing software
The primary focal point of this SDLC stage is to guarantee that requirements keep on being met and that
the framework keeps on proceeding according to the particular referenced in the principal stage.[6]

III. Solution.

1. Program Language:
I will utilize C# (C Sharp) to tackle this issue. C # (C Sharp) is an amazingly ground-breaking, object-
arranged programming language. C # is based on C ++ and Java, likewise two incredibly amazing[1,2]
programming dialects.

2. Supporting Tool:
• Visual Studio 2017 for write source and compile it.

3. Component in C#.

a) Data-type:
In C#, we have 2 types of data-type Value type: integer, float, double,...
References type: Class, interface, array, delegate .

b) Variables:
Applications use factors to store the important information or information made during program
execution. Factors are distinguished by a variable name and have an effect range. The extent of effect of the
variable is unmistakably characterized in the program. Every factor proclaimed in a program block just has
an effect inside that block, has no importance and isn't available from outside the square. [7]

c) Constant:

d) Expressions:
• Arithmetic expression: Return value is a number or character, string.
• Operator: + , - , * , / , % , ++ , -- , += , -= , ...
• Relationship expression: == ,

Page 9 of 27
4. Procedural programming.
Procedural programming is an upgrade of unstructured programming. It Divide a large program into
smaller programs is called functions. Procedural programming language and code are handled faster and
require less memory. In addition, procedural programming languages permit developers to develop general
purpose programming and create better levels of mobile source control. Features main of procedural
programming languages: Function: in procedural functions similar to procedures but created or returned
with the help of values. In addition, ion function can also be used to return values, parameters. Local and
global variables: Local variables in the program are only used in the set area. On the other hand, global
variables can be used anywhere in programming code, this process is best for building programs. Parameter
passing: the parameter transfer provides variable values passed through the program for the procedure.
Procedure: In procedural language procedural programming is in sequence according to the sequence of
instructions. Also, in this programming language, the program does exactly what the programmer said.
Programming library: in procedural language programming program libraries that contain a set of
subprograms, built-in sources, values and classes that can be used by any user and program when.[7]

5. List data types, data structures needed in the problem:


The company's sales app asks to sell to people 16 or older only. So I need a function that controls the
age of the visitor, and also the variable that controls the quantity and money of the product so the data type
for these variables must be integer type (int).
Besides the integer data type, my program needs other data types, which is the string type (string) for
account creation and login. Character type (char) to warn some choices in the program and some variables
that may be generated.
To display the names of the products beautifully, I created a basic menu so that visitors could have an
overview of the product and make a choice of which item to buy. In order for the visitor to select products
and carry out the purchase I use the switch ... case structure to create menu options.

Conditional statements needed in the problem:


In the program, I use the if ... else conditional statement to check whether the age of the visitor is valid
or not. Besides, the if ... else conditional is also used to test some options in the application.

Loop statement needed in the problem:


The loop structure used mainly in the application is a do ... while structure that makes menu selections
until the requester finishes. Without the do ... while statement, the visitor may miss out on some data
items.

Page 10 of 27
6. Hierarchy diagram for program

Figure 2 Hierarchy diagram

Page 11 of 27
7. A use case diagram for actions required

Figure 3 use case diagram

Page 12 of 27
8. Flowchart

a) Checkage:

Figure 4 Flowchart of checkage

Page 13 of 27
b) Creat account

Figure 5 Flowchart of account

Page 14 of 27
c) Menu

Figure 6 Flowchart of Menu

Page 15 of 27
IV. Implementation

1. Operation Implementation

2. Start screen

In the above screen is the greeting when the customer starts to access the application. To start buying, users
need to enter their own age to access the store's menu.

Page 16 of 27
3. Enter age

At this step, when you enter your age is less than 16, the screen will say "you are not old enough to
buy this product". If your age is valid, you will go to the next step which is to create an account .

Page 17 of 27
4. Creat account

When you enter the letter "n" or "N", the program will ask you to enter your username and password to
register. Once the account is registered, you will have to re-enter the username and password you just signed
up for to log in. If either username or password is incorrect, you will have to re-enter it. After successful
login you will go to the following step.

Page 18 of 27
In case customers have existing accounts of the company, they can enter "y" or "Y" to proceed with
login. The user must enter the correct username of the company as "admin" and the company's password
"admin" in order to purchase.

Page 19 of 27
If you enter characters outside the message, the program will force you to make a new choice.

Page 20 of 27
5. Menu

Page 21 of 27
After successful login, the screen will display the menu of the company's goods. Customers can rely on
the menu to choose the product they want to buy. After selecting the product, the user enters the quantity of
the product he wants to buy, the program will print the amount you have to pay for the item you bought and
return to the menu screen. Customers can choose to continue or exit the program by pressing the number 5
key. In the menu there are options from 1 to 5, besides the above numbers, any other characters are invalid.

Page 22 of 27
Page 23 of 27
Page 24 of 27
Page 25 of 27
V. Conclusion.
My program basically solved the company's problem. Customers can now buy the company's products
online, thereby helping the company expand its market. I have used a few functions to make future repairs
and upgrades easier. Besides, the program is still quite simple, complex cases can occur and need to be
fixed. The program can upgrade some more features such as printing invoices, confirming payments via
banks, confirming identity cards, ...

Page 26 of 27
VI. References
1. Rochkind, Marc J. (2004). Advanced Unix Programming, Second Edition. Addison-Wesley. tr. 1.1.2.
2.En.wikipedia.org. (2019). Computer program. [online] Available at:
https://en.wikipedia.org/wiki/Computer_program#cite_note-aup-ch4-p132-1 [Accessed 8 Dec. 2019].
3. →, V. (2019). Difference between System Software and Application Software - The Crazy Programmer.
[online] The Crazy Programmer. Available at: https://www.thecrazyprogrammer.com/2016/04/difference-
system-software-application-software.html [Accessed 8 Dec. 2019].
4. Techopedia.com. (2019). What is an Algorithm? - Definition from Techopedia. [online] Available at:
https://www.techopedia.com/definition/3739/algorithm [Accessed 8 Dec. 2019].
5. Edrawsoft.com. (2019). What is Algorithm - Definition, Types and Application. [online] Available at:
https://www.edrawsoft.com/algorithm-definition.php [Accessed 8 Dec. 2019].
6. Kochan, S. (2005). P Kochan, S. (2005). Programming in C. Indianapolis, Ind.: Developer's
Library/Sams Pub.
7. Tutorialspoint.com. (2019). Program Maintenance - Tutorialspoint. [online] Available at:
https://www.tutorialspoint.com/programming_methodologies/programming_methodologies_program_
maintenance.htm [Accessed 8 Dec. 2019].

Page 27 of 27

You might also like