Ruzan Programming Final Assignment - 082943
Ruzan Programming Final Assignment - 082943
Miss.Irani
Assessor Internal Verifier
Unit 01 - Programming
Unit(s)
Assignment title
Mohamed Ruzan
Student’s name
List which assessment criteria Pass Merit Distinction
the Assessor has awarded.
Give details:
Internal Verifier
Date
signature
Programme Leader
Date
signature (if required)
LO1. Define basic algorithms to carry out an operation and outline the process of programming an application.
LO2. Explain the characteristics of procedural, object-orientated and event-driven programming, conduct an analysis of a
Integrated Development Environment (IDE).
LO4. Determine the debugging process and explain the importance of a coding standard.
Pass, Merit & Distinction Descripts P4 P5 M4 D4
* 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
Action Plan
Summative feedback
Assessor Date
signature
E161001@esoft.academy
Student Date
signature
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.
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
Issue Date
Submission Date
Submission Format
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
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.
Ayubo Drive is the transport arm of Ayubo Leisure (Pvt) Ltd, an emerging travel & tour
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
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.
In order to complete my assignment, I needed to enlist the assistance and counsel of some
highly respected individuals, for whom I am eternally grateful. As completing this
assignment gave me a lot of pleasure, I'd like to thank Ms. Irani, Course Instructor at Esoft
Metro Campus, for providing me with good guidelines for this assignment through
numerous consultations and feedback. I'd also like to thank everyone who has helped me
with this assignment, both directly and indirectly. Many people, particularly my batch
mates, provided insightful comments and suggestions on my system, which inspired me to
improve the quality of the assignment.
Thank You!!!
What is an Algorithms?
A process or set of rules to be followed in calculations or other problem-solving
operations is referred to as an algorithm. An intricate computer program can be
thought of as an algorithm. In mathematics and computer science and an algorithm
is a small procedure that solves a recurring problem. Algorithms are used in every
computerized device to reduce the time required to do things manually.
Characteristics of an Algorithm
(Upadhyay
, n.d.)
A programmer must go through the seven steps of the program development process
following the steps to develop a computer program:
4. Test execution
6. Final documentation
Flowchart
Flowchart symbols
(Asana, n.d.)
• Easy to make
• Analysis becomes effective
• Debugging becomes possible
• Mistakes can be easily identified
Disadvantages of flowchart
Start
Get score
NO
0<=score<=
100
YES
YES
Score=>75
A
NO
Score=>65 YES
B
NO
YES
Score=>50
C
NO
Fail
BEGIN
total = 0
grade_counter = 1
while grade_counter <= 10
input grade
total = total + grade
grade_counter = grade_counter + 1
class_avarage = total / 10
print class_avearge
END
The Fibonacci sequence is a series of number named after the Italian mathematician
Fibonacci. It’s just a string of numbers that starts with 0 and 1 and continues by
adding the two numbers before it.
Solution:
F2 = F1+F0 = 1+0 = 1
F3 = F2+F1 = 1+1 = 2
F5 = F4+F3 = 3+2 = 5
Function fib(n)
If n<=1 then:
Return n
Else
End function
PROGRAME
Start
Input num
If returns<=0
Else
For I in range(returns)
Print(var)
End
3 3 F 0 0
2 F 1 1
1 1 1
Figure 3output
Factorial series
Finding the factorial of a number is a common requirement in data analysis and other
python-based mathematical analysis. For a positive integer, the factorial is always
fund by multiplying all integers from 1 to the given number. There are three ways to
find this, as shown below.
Function fact(num2)
If num2==0:
Return 1
Else:
Return num2*factorial(num2-1)
End function
Input num
If num<0:
Else:
N=fact(num)
Print(n)
End
3 3 F 3* fact 2 6
2 F 2* fact 3
1 T 1* fact 0
Output Positive
Output Negative
Python code:
def recur_fibo(n):
if n <= 1:
return n
else:
return(recur_fibo(n-1) + recur_fibo(n-2))
nterms = 10
if nterms <= 0:
else:
for i in range(nterms):
print(recur_fibo(i))
Model the time function for calculating Fib(n) as the sum of the time it takes to
calculate Fib(n-1) plus the time it takes to add the two together (O (1)). This assumes
that subsequent evaluations of the same Fib (n) require the same amount of time - that
is, there is no memorizing.
T (n<=1) = O (1)
The solution will be obtained by solving this recurrence relation (for example, using
generating functions).
Draw the recursion tree with depth n and intuitively determine that this function is
asymptotically O.(2n). Induction can be used to prove the hypothesis.
Base: n = 1 is obvious
An interesting fact about this function is that the T (n) is asymptotically the same as
the value of Fib (n) since both are defined as
The recursion tree's leaves will always return one. Fib (n) is the sum of all values
returned by the recursive tree's leaves that are equal to the number of leaves. T (n)
equals Fib (n) x O because each leaf will take O (1) to the computer (1). As a result,
the Fibonacci sequence ((1.6n)) is the tight bound for this function. You can discover
this tight bond by using the generating functions I mentioned earlier.
Activity 2
Programming paradigm
The question of why are there many different programming paradigms is similar to
why are there many programming languages. Certain paradigms are better suited for
certain types of problems, so it makes sense to use different paradigms for different
kinds of projects.
Also, the practices that make up each paradigm have developed through time. Thanks
to the advances both in software and hardware, different approaches have come up
that didn't exist before.
And last I think, there's human creativity. As a species, we just like creating things,
improving what others have built in the past, and adapting tools to our preference or
to what seems more efficient to us.
All this results in the fact that today we have many options to choose from when we
want to write and structure a given program. (Cocca, n.d.)
To understand the example of procedural language we write a program for adding two
numbers in C. The option of two numbers in C language is playing out the math
activity of including them and printing their entirety on the screen. For instance, if the
information is 2, 3, the yield will be 5.
#include <iostream.h>
Int main () {
Int b;
Int c;
c = a + b;
return 0;
Examples:
Ex 1:
Figure 7 output
Ex 2:
MohamedFigure
Ruzan8 pythne code for PP Unit 01 Programming 36
Figure 9 output
• Classes - You must first develop a class before you can generate objects. A
class is a template that specifies an object’s priorities and methods. Simply put
a class is a collection of items.
• Inheritance - Reusability is another name for inheritance. The practice of
passing on data, members, and methods from one class to another, as well as
the ability for a class to have its own, is known as inheritance. Simply we can
also state that inheritance is the facility that allows for code reuse. It is one of
the co characteristics of OOP.
• Encapsulation- Encapsulation is the process of combining data and procedures
into a single entity.
• Data Abstraction- Data abstraction, said simply, is data hiding. The method of
displaying the crucial feature without knowing the context is known as data
Figure 11 output
Class:
Figure 12 class
Objective:
Figure 14 object 2
In addition to being objects, methods can also relate to a class's function. Below are
several methods.
Event-Driven Programming
Example:
Rent calculation
Rent calculation
Evidences
Create Database
Create tables
The launch event and general release of Microsoft Visual Studio 2012 is imminent. I
keep getting email messages from my international .NET Association (INETA)
brethren about hosting an upcoming Visual Studio 2012 community launch event,
which suggests that the news will be public by the time you read this. Other than
Visual Studio, is there any other software that developers automatically upgrade to
without even questioning? Is there any other piece of software that you find you need
to get your hands on as much as this one?
As developers, we do love our tools. And there's no tool that's more important for
building software on the Microsoft platform than Visual Studio. Many developers
aren't the crazy type like me that would attempt to build production software on
prerelease tools. But I'm expecting that the majority of developers will switch to the
latest and greatest version when Visual Studio ships for production.
Interestingly enough, the first and last time I stood on stage next to Bill Gates was
when he was presenting a demo for the Visual Studio .NET 2003 launch event in
2003. My, how time has flown. Visual Studio has been on a new-version shipping
cadence of about every two years since then, as Table 1 shows, so we're right on track
for a fall release. (Huckaby, n.d.)
1. Project: You should be able to create projects and open a single project in a
single window or multiple (better if in multiple windows, otherwise things go
a little slow). In this way you will be able to have all you project files listed
right beside your coding script just like file and folder browser.
2. Coding suggestion: While coding in a project which is so huge and you are
working on it for long time, it is obvious that you will forget not only language
specific methods and class names, but also your own variables, constants,
classes and method names. So, the good IDE must suggest you these whenever
you are typing.
3. Lite weight and fast: I understand, to provide you the previously mentioned
features an IDE will be working always and will keeping a lot of data in the
RAM. So, your IDE will become a little less responsive while opened for a
very long time. But still, if you have a multiple number of choices than pick
the one that takes less RAM.
4. Sub-Version: If your work in an environment that uses SVN then your IDE
should also. You should be able to commit and update directly from your IDE
and also the IDE should highlight files that has been changed and needs to be
committed.
5. Syntax Errors: I believe, this is important than coding suggestion. While
coding scripts, in early stages, missing semicolon at the end of a statement is
very common. A good IDE must highlight this and another like
Conclusion
Without an IDE, programmers will face numerous challenges because these tools,
which include a source code editor, complier, interpreter and debugger make it
easier to create software. As a results, IDE must be used for such a program to be
efficient and effective.
• Syntax errors
• Typos
• Errors in logic
• Implementation errors (Anon., n.d.)
Condition Breakpoint: By making it possible to locate the fault, this helps to stop the
recurrence.
Figure 40breakpoints
Execution Point: These indicate the line on which the execution is occurring.
1 2 3
1. Step Into- This allows you to call the function and watch the code as it runs.
2. Step Over- It is used to advance to the next line while the code is running.
3. Step Out- This is used to exit the function rather than running the function line
by line, which advances to the next statement.
Error list: This aided me in identifying flaws in the program and determining where
it went wrong. According to the error message below, a ";" is therefore expected.
Problem 1
Figure 44 problem 1
The above error occurs due the single quotation inserted at code.
Figure 46 problem 2
The above error occurred due to spelling mistakes, and it was corrected from
“WriteeLine” to “WriteLine”.
Different modules specified in the design document are coded in the Coding phase
according to the module specification. The main goal of the coding phase is to code
from the design document prepared after the design phase through a high-level
language and then to unit test this code.
4. Indentation:
Proper indentation is very important to increase the readability of the code.
For making the code readable, programmers should use White spaces
properly. Some of the spacing conventions are given below:
• There must be a space after giving a comma between two function arguments.
• Each nested block should be properly indented and spaced.
• Proper Indentation should be there at the beginning and at the end of each
block in the program.
• All braces should start from a new line and the code following the end of
braces also start from a new line.
On the other hand, Coding guidelines give some general suggestions regarding the
coding style that to be followed for the betterment of understandability and readability
of the code. Some of the coding guidelines are given below :
Conclusion
Although coding standards have drawbacks, they are necessary when developing a
system. It has served as the system’s foundation. It can be used with ease if properly
maintained. It has more advantages than disadvantages. Coding standards must be
used for such a system to be productive and functional.