1.2.
3 INTRODUCTION TO PROGRAMMING
Procedural programming uses a sequence of instructions which may be
contained within in broken down procedures-carried out sequentially
STRUCTURED PROGRAMMING-uses the three main programming
structures sequence, selection and iteration
SEQUENCEcode is executed line by line from top to bottom
SELECTIONa certain block of code is run if a certain condition is met
using an if ,else if, else statement
ITERATIONa block of code is executed a certain number of times or while
a condition is met using for, while or repeat until loops
VARIABLEnamed locations in memory where data is stored
The contents of this location can be changed while the program is being
executed
CONSTANTnamed locations in memory but the value of this cannot be
edited by the program during execution, helps prevent accidental changes
PROCEDUREnamed block of code that performs a specific task that does
not return a value
FUNCTIONnamed block of code that performs a specific task that does
return a value
2**4 exponentiation ,2 to the power 4
DIV integer division
MODremainder
stringname.substring(0,5) takes characters 0,1,2,3,4
FILE HANDLING
myFile= openRead(“filename,txt”) opens a file TO READ IT
fileContent=myFile.readLine() reads a line from a file
myFile.close()to close a file
myFile=openWrite(“nameofffile.txt”)open a file to WRITE TO IT
myFile.writeLine(“Physics and Maths Tutor”)to write this line to a file
endOfFile()the end of file is given by this it checks if the file has no more
lines to read
READING A FULL FILE PSEUDOCODE
myFile=openRead(“data.txt”)
WHILE NOT endOfFile(myFile)
  line = myFile.readLine()
  OUTPUT line
ENDWHILE
myFile.close()
WRITING TO A FILE FULL PSEUDOCODE
myFile = openWrite("results.txt")
myFile.writeLine("A* in Computer Science")
myFile.writeLine("Well done!")
myFile.close()
ASSEMBLY LANGUAGE
ADDAdds the value at the given memory address to the value in the
accumulator
SUBSubtracts the value at the given memory address to the value in the
accumulator
LDALoads the value at the given memory address into the accumulator
STAStores the value in the accumulator at the given memory address
BRZBranches to a given address if the value in the accumulator is zero
(conditional branch)
BRPBranches to a given address if the value in the accumulator is
positive (conditional branch)
BRABranches to a given address if the value in the accumulator is
positive (unconditional branch)
DATCreates a flag with a label at which data is stored
HLTStops the program at that line preventing the rest of the code from
executing
INPAllows the user to input a value which will be held in the accumulator
PROGRAMMING METHODOLOGIES
Most software development life cycles have some stages in
common ,these phases are known as the SDLC
ANALYSIS: Stakeholders state what they require from the finished product
to clearly define and identify the problem and system requirements. They
are defined by analysing strengths and weaknesses with the current way
this problem is being solved, considering types of data involved.
DESIGN: The different aspects of the new system are designed e.g. inputs,
outputs ,security features, hardware set up, user interface. A test plan can
also be made at this stage
DEVELOPMENT: The design is used to split the project into individual ,self-
contained modules which are allocated to teams for programming .The
solution is coded
TESTING: The program is tested against the test plan formed in the design
stage eg alpha testing(in house within the development team) ,beta
testing (carried out by end users to get feedback), white box testing
(testing based on internal structure of program testing all possible
routes),black box testing (testing without awareness of internal structure
using inputs and outputs within the software)
IMPLEMENTATION: Once the testing stage has been used to make
appropriate changes to the software, it is installed onto the users’ systems
.
EVALUATION: After the implementation stage the effectiveness of the
software is evaluated against the system requirements that was defined
during analysis. Considering
robustness ,reliability ,portability ,maintainability.
MAINTENANCE: Any errors or improvements are flagged by end
users .Programmers will regularly send out software updates to fix any
bugs/security issues. There are CORRECTIVE,ADAPTIVE AND PERFECTIVE
maintenances done
The arrangement of the above phases and how programmers move from
one phase to another is known as the software development methodology.
There are five main methodologies to be aware of.
WATERFALL LIFECYCLE
-series of stages completed in sequence from start to finish
-each phase has a well-defined start and end point
Analysisdesigndevelopmenttestingimplementationevaluation
maintenance
-the analysis stage has a feasibility study that uses TELOS (technical-with
available tech ,economic-affordable ,legal ,operational-successful to make,
scheduling-possible in time frame)
-if a change needs to be made within a project all levels between the
current one and the one being fixed has to be revisited , this makes it
inflexible and unsuitable to projects with changing requirements.
-best suited for well understood and stable requirements
-users have little inputs as they are only involved at the beginning and
end (analysis and evaluation)
RAPID APPLICATION DEVELOPMENT
-producing successive prototypes of the software until a final version is
produced and approved
-after initially approving that the program is feasible in the analysis stage
prototypes are designed, coded, tested and evaluated with the end user.
-The user then decides if they are satisfied with the system or if they need
further improvements to start a new cycle (iteration)
-Best suited for projects with rapidly changing requirements, it
emphasizes speed over full planning and may use reusable components
SPIRAL MODEL
-a risk driven development methodology ,any project has its own set of
unique risks associated with it the spiral model focuses on managing risk
at every stage
-the spiral model is more of a guide for development teams, and it
combines ideas from the waterfall model and iterative development
-it is not a fixed process followed in a specific order it is dependant on the
project and its unique risks -the risks identified guide what methodology is
best suitable
1) determine objectives ,identify alternatives and assess risks e.g. cost,
not meeting needs, wrong technology, security or performance issues
2)evaluate alternatives and reduce risks eg planning ,prototypes, research
,adjusting plans
3)develop and test following chosen methodology
4)review and plan next iteration
-the spiral repeats with each loop getting closer to the final high quality
completed product
-At the start of each iteration we analyse risks before deciding upon the
methodology and path taken
-it is a process model generator where the decisions on the development
methodology are made based on the risks identified
AGILE METHODOLOGIES
-refers to a group of methodologies
-focuses on idea that requirements will shift and change during
development -this can only be dealt with by developing software in an
iterative way
-A product is built in a series of iterations known as sprints; these are
short time boxed periods when a team has focussed goals to complete a
set amount of work
-Each sprint should ideally be a bite sized piece of focussed work in a
specified time frame no more than one to four weeks
-Each sprint has planning, designing ,developing,
testing ,deploying ,evaluate, launch
EXTREME PROGRAMMING
Not so much a methodology as a frame work
-it aims to produce VERY high-quality code and promotes developers
quality of life by encouraging them to adopt common practices e.g.
simplicity, communication feedback, courage ,respect.
-it is considered an agile framework that encourages regular small
iterative software releases
-the concepts of collective ownership and every team member being of
equal value
-some specific practice examples :pair programming(two people
developing together one writes other reviews) ,collective code
ownership(any developer can modify any part at any time), continuous
integration(integrate code changes into the main project for automatic
implementation testing) , code standards ,refactoring (reorganising and
structuring) etc
MERITS,DRAWBACKS AND USES OF PROGRAMMING
METHODOLOGIES
              MERITS               DRAWBACKS               USES
Waterfall     -straight forward    -lack of flexibility    -static ,low risk
              to manage due to     cant go back and        project which
               sequential process    make changes after      needs little
               -clearly              each stage              user input
               documented as         -no changing            -eg general
               each stage has        requirements            purpose
               defined outputs       -late testing           software
                                     discovering errors      -clear
                                     too late                unchanging
                                     -no risk analysis can   requirements
                                     cause problems          eg embedded
                                     -limited user           system
                                     involvement(start
                                     and end)
Agile          -produces high        -poor documentation     -small to
               quality code          -requires consistent    medium
               -flexible to          interaction between     projects with
               changing              user and                unclear initial
               requirements          programmer              requirements
               -regular user input
Extreme        -produces high        -paired programming     Small to
programmi      quality code          causes high labour      medium
ng             -constant user        costs                   projects with
               involvement           -team work is           unclear initial
               means high            essential               requirements
               usability             -end user may not       requiring
                                     be able to be           excellent
                                     present                 usability
Spiral         -thorough risk        -expensive to hire      -large risk
               analysis and          risk assessors          intensive
               mitigation            -lack of focus on       projects with
               -caters to            code efficiency         high budget
               changing user         -high costs due to
               needs                 constant prototyping
               -produces
               prototypes
               throughout
Rapid          -caters to            -poorer quality         Small to
Application    changing user         documentation           medium low
Developme      requirements          -fast pace may          budget projects
nt             -highly usable        reduce code quality     with short time
               finished product                              frames
               -focuses on core
               features reducing
               development time
AGILE VS RAD
-agile focuses on incrementally building the full software through small
sprints ,each sprint can work on chunks of the project/various features
-RAD focuses on building prototypes that are not fully functional versions
of the software with key elements until user satisfaction is reached
BOTH iterative development methodologies where a cycle or phase in
which a portion of the project is worked on :developed,tested and
reviewed.