Programming Assignment
Programming Assignment
Give details:
LO1. Define basic algorithms to carry out an operation and outline the
proce ss of programming an application.
Pass, Merit & Distinction Descripts P1 M1
D1
LO2. Explain the characteristics of procedural, object-orientated and driven programming, conduct an
event- analysis
Integrated Development Environment (IDE).
* Please note that grade decisions are provisional. They are only confirmed once internal and external moderation has taken place and
grades decisions have been agreed at the assessment board.
Assignment Feedback
Formative Feedback: Assessor to Student
Action Plan
Summative feedback
Assessor Date
signature
Student Date
signature
Pearson Higher Nationals in
Computing
Unit 01: Programming
Assignment 01
General Guidelines
1. A Cover page or title page – You should always attach a title page to your
assignment. Use previous page as your cover sheet and make sure all the details are
accurately filled.
2. Attach this brief as the first section of your assignment.
3. All the assignments should be prepared using a word processing software.
4. All the assignments should be printed on A4 sized papers. Use single side printing.
5. Allow 1” for top, bottom , right margins and 1.25” for the left margin of each page.
1. The font size should be 12 point, and should be in the style of Time New Roman.
2. Use 1.5 line spacing. Left justify all paragraphs.
3. Ensure that all the headings are consistent in terms of the font size and font style.
4. Use footer function in the word processor to insert Your Name, Subject,
Assignment No, and Page Number on each page. This is useful if individual sheets
become detached for any reason.
5. Use word processing application spell check and grammar check function to help
editing your assignment.
Important Points:
1. It is strictly prohibited to use textboxes to add texts in the assignments, except for the
compulsory information. eg: Figures, tables of comparison etc. Adding text boxes in
the body except for the before mentioned compulsory information will result in
rejection of your work.
2. Carefully check the hand in date and the instructions given in the assignment. Late
submissions will not be accepted.
3. Ensure that you give yourself enough time to complete the assignment by the due
date.
4. Excuses of any nature will not be accepted for failure to hand in the work on time.
5. You must take responsibility for managing your own time effectively.
6. If you are unable to hand in your assignment on time and have valid reasons such as
illness, you may apply (in writing) for an extension.
7. Failure to achieve at least PASS criteria will result in a REFERRAL grade .
8. Non-submission of work without valid reasons will lead to an automatic RE
FERRAL. You will then be asked to complete an alternative assignment.
9. If you use other people’s work or ideas in your assignment, reference them properly
using
HARVARD referencing system to avoid plagiarism. You have to provide both in-text
citation and a reference list.
10. If you are proven to be guilty of plagiarism or any academic misconduct, your grade
could be reduced to A REFERRAL or at worst you could be expelled from the course
Student Declaration
I hereby, declare that I know what plagiarism entails, namely to use another’s work and to
present it as my own without attributing the sources in the correct way. I further understand
what it means to copy another’s work.
Unit Tutor
Assignment Title Design &Implement a GUI based system using a suitable
Integrated Development Environment
Issue Date
Submission Date
Submission Format
This submission will have 3 components
1. Written Report
This 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. (The recommended word count is 1,500–2,000 words for the
report excluding annexures)
3. Presentation
With the submitted system student should do a presentation to demonstrate the system that was
developed. Time allocated is 10 to 15 min. Student may use 5 to 10 PowerPoint slides while doing
the presentation, but live demonstration of the system is required. Evaluator will also check the
ability to modify and debug the system using the IDE.
LO1. Define basic algorithms to carry out an operation and outline the process of
programming an application.
LO4. Determine the debugging process and explain the importance of a coding
standard
Assignment Brief and Guidance:
Activity 1
A. The Fibonacci numbers are the numbers in the following integer sequence.
0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, ……..
In mathematical terms, the sequence Fn of Fibonacci numbers is defined by the recurrence
relation.
Fn = F n-1 + F n-2
Define what an algorithm is and outline the characteristics of a good algorithm. Write the
algorithms to display the Fibonacci series and the factorial value for a given number using
Pseudo code. Determine the steps involved in the process of writing and executing a
program.
Take a sample number and dry run the above two algorithms. Show the outputs at the end
of each iteration and the final output. Examine what Big-O notation is and explain its role
in evaluating efficiencies of algorithms. Write the Python program code for the above two
algorithms and critically evaluate their efficiencies using Big-O notation.
Activity 2
2.1 Explain what is meant by a Programming Paradigm and the main characteristics
of Procedural, Object oriented and Event-driven paradigms and the relationships
among them. Write small snippets of code as example for the above three
programming paradigms using a suitable programming language(s). you also need to
critically evaluate the code samples that you have given above in relation to their
structure and the unique characteristics.
Activity 3 and Activity 4 are based on the following Scenario.
Ayubo Drive is the transport arm of Ayubo Leisure (Pvt) Ltd, an emerging travel & tour
company in Sri Lanka. It owns a fleet of vehicles ranging from cars, SUVs to vans.
The vehicles that it owns are hired or rented with or without a driver. The tariffs are based on the
vehicle type. Some of the vehicle types that it operates are, small car, sedan car, SVUs, Jeep
(WD), 7-seater van and Commuter van. New vehicle types are to be added in the future.
1. Rent (With or without driver) – For each type of vehicle rates are given per day, per week
and per month. Rate for a driver also given per day. Depending on the rent period the total
rent amount needs to be calculated. For example: if a vehicle is rented for 10 days with a
driver, total amount to be calculated as follows:
2. Hire (with driver only) – These are based on packages such as airport drop, airport pickup,
100km per day package, 200km per day package etc. Standard rates are defined for a
package type of a vehicle typeif that is applicable for that type of vehicle.For each package
maximum km limit and maximum number of hours arealso defined. Extra km rate is also
defined which is applicable if they run beyond the allocated km limit for the tour. For day
tours if they exceed max hour limit,a waiting charge is applicable for extra hours. Driver
overnight rate and vehicle night park rate also defined which is applicable for each night
when the vehicle is hired for 2 or more days.
Activity 3
Write suable algorithms for vehicle tariff calculation for rents and hires. Ideally 3
functions should be developed for this purpose as above. Use the visual studio IDE
(using C#.net) to Implement the above algorithms and design the suitable database
structure for keeping the tariffs for vehicle types and different packages which must be
used for implementing the above functions.
Analyze the features of an Integrated Development Environment (IDE) and explain how
those features help in application development. Evaluate the use of the Visual StudioIDE
for your application development contrasted with not using an IDE.
Activity 4
4.1 Design and build a small system to calculate vehicle hire amounts and record them in a
database for customer billing and management reporting forAyubo drive. This includes the
completing the database design started in 3.2 and implementing one or more GUIs for
vehicle, vehicle type, and package add/edit/delete functions. It essentially requires an
interface for hire calculation and recording function described above. Generating customer
reports and customer invoices are not required for this course work.
4.2 Explain debugging process and the features available in Visual studio IDE for debugging
your code more easily. Evaluate how you used the debugging process to develop more
secure, robust application with examples.
4.3 Outline the coding standards you have used in your application development. Critically
evaluate why a coding standard is necessary for the team as well as for the individual.
Grading Rubric
I would like to thank Esoft for updated education system in Sri Lanka. Lastly I
would like to deliver my thanks to all the HND students for their cordial
cooperation. It was not possible for me to complete a severe task without such
help. So, I thank again for all the persons who have helped and co-operated me
in my assignment research.
Chapter 01
1.1. Algorithm
An algorithmic program is any well-defined computation procedure that takes some information
or set info} as input and produces information as output. The associate algorithmic program
sometimes means a little procedure that solves a repeated drawback. Algorithms area unit wide
used throughout all areas of IT. a pursuit engine algorithmic program, encoding algorithmic
program, and word algorithms area unit is often taken as examples. However, it's usually used
for processing, calculation, alternative connected laptop, and mathematical operations.
(Contributor, 2019)
1.1.1. Characteristics of an Algorithm
1. Finiteness: An algorithm should have finite number of steps and it should end after a
finite time.
2. Input: An algorithm may have many inputs or no inputs at all.
3. Output: It should result at least one output.
4. Definiteness: Each step must be clear, well-defined and precise. There should be no any
ambiguity.
5. Effectiveness: Each step must be simple and should take a finite amount of time.
1.1.1.1. Fibonacci numbers
The Fibonacci sequence is a series of numbers: -
n= 0 1 2 3 4 5 6 7 8 9
In here the next number is found by adding the current and the previous number together.
Xn = 0 1 1 2 3 5 8 13 21 34
Table 1- Fibonacci numbers(Author Produced)
So, according to the description and the sequence pattern, the next number in the series will be:
=21+34
=55
Start
Input Value of N
A = 0, B = 1, COUNT = 2
WRITE A, B
IF (COUNT > N)
NEXT = A + B
WRITE NEXT
A=B
B = NEXT
COUNT = COUNT + 1
Stop
Flowchart for Fibonacci Series
Output
Figure 3-Converting Fibonacci number into algorithm by python OUTPUT(Author Developed)
Find the 10th Fibonacci number by python program,
Input
Figure 4-Source code for finding the 10th Fibonacci number by python program,(Author Developed)
Output
Figure 5-Output for finding the 10th Fibonacci number by python program,(Author Developed)
The factorial function says to multiply all whole numbers from our chosen number down to
1. (Symbol:)
As an example, factorial value of 9
9*8*7*6*5*4*3*2*1 = 362,880
n n!
1 1 1
2 2*1 2
3 3*2*1 6
4 4*3*2*1 24
5 5*4*3*2*1 120
Table 2- Factorial Value Table(Author Developed)
Output
Figure 7-Output of the python code(Author Developed)
Chapter 02
2.1. Programming Paradigm
A programming paradigm is the classification, style or way of programming. It is an approach to
solve problems by using programming languages. Depending on the language, the difficulty of
using a paradigm differs.
Common Programming Paradigms: -
Imperative: Programming with an explicit sequence of commands.
Declarative: Programming by specifying the result a user wants, instead of how to get it.
Structured: Programming with clean control structures.
Procedural: Imperative programming with procedure calls.
Functional: Programming with function calls that avoid any global state.
Function-Level: Programming with no variables at all.
Object-Oriented: Programming by defining objects that send messages to each other.
Event-Driven: Programming with emitters and listeners of asynchronous actions.
Flow-Driven: Programming processes communicating with each other over predefined channels.
Logic: Programming by specifying a set of facts and rules.
Constraint: Programming by specifying a set of constraints.
Aspect-Oriented: Programming cross-cutting concerns applied transparently.
Reflective: Programming by manipulating the program elements.
Array: Programming with powerful array operators.
(Team, 2018)
2.1. Procedural Programming (imperative programming)
This is a programming paradigm that uses a linear or top-down approach and
relies on procedures or subroutines in order to perform computations.
(Technopedia, 2019)
/* Calculate amount
Amount = (Month_ rate*Months + Week_ rate*Weeks + Day_ rate*No_ days)
If (With_ driver == True) then
Total_ amount = Amount + Driver_ rate*No_ days
Else
Total_ amount = Amount
End If
Display Total_ amount
End function
/* calculate km
No _km = end _km – start_ km
If (No _km > Maximum_ km) then
Extra_ km = No _km – Maximum _km
Else
Extra _km = 0
End If
/*calculate No _km
No _km = end _km – start_ km
Allowed _km = Maximum_ km * Total_ days
If (No _km > Allowed _km) then
Extra _km = No _km – Allowed_ km
Else
Extra _km = 0
End If
*Server Explorer
This developing windows application uses server explorer to work with data. This is a key
feature of the server browser.
4.1. Design and build a small system to calculate vehicle hires and record
them in a database for customer billing and management for Ayubo
Drive.
The first user should connect the windows form application to the Ayubo drive database using
the SQL server management studio. The tables are then fixed in the Ayubo drive database. After
that user can enter the package details in the tables, update the information and delete the details
in the tables. In this form, this information enters through the Visual Studio IDE. There are the
main features that Visual Studio gives via IDE.
*Rent Page