0% found this document useful (0 votes)
4 views11 pages

AS CS MS Paper 2 Notes

The document outlines key concepts in computer science, focusing on abstraction, programming techniques, software development methodologies, and algorithms. It discusses the importance of abstraction in simplifying programming, the differences between global and local variables, and various testing strategies. Additionally, it covers software development models like Waterfall, Extreme Programming, and Spiral, emphasizing their unique characteristics and suitable applications.

Uploaded by

mohit.reddy
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views11 pages

AS CS MS Paper 2 Notes

The document outlines key concepts in computer science, focusing on abstraction, programming techniques, software development methodologies, and algorithms. It discusses the importance of abstraction in simplifying programming, the differences between global and local variables, and various testing strategies. Additionally, it covers software development models like Waterfall, Extreme Programming, and Spiral, emphasizing their unique characteristics and suitable applications.

Uploaded by

mohit.reddy
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 11

AS CS MS Notes Paper 2

2.1.1 Thinking Abstractly:

 What is the need for abstraction? Sample Q6


o Real … contains things that aren’t relevant to the … (check it
again)
o Which would require necessary programming/design effort
o … would require extra computational resources
o … could detract from the main purpose of the program
 Definition – Abstraction is the process of removing
characteristics/elements /detail from a problem.
 Identify two reasons why abstraction is needed in the rail network
program. 2018 Q3
o Reduce processing requirements
o Simplify programming
o Reduce memory requirements
 Explain two benefits of Sally using abstraction before creating the
programming code? 2020 Q1
o Reduced development time (1) as factors that can detract
from the program can be ignored (1).
o Program more likely to solve the problem (1) as unnecessary
aspects will not detract from the main purpose of the program
(1).
o Reduces complexity of programming code (1) therefore can
run on lower spec computers (1)

2.1.2 Thinking Ahead:

2.1.3 Thinking Procedurally:

 State what is meant by a count controlled loop


o A loop that repeats a fixed/set number of times.

2.1.4 Thinking Logically:


2.2.1 Programming Techniques:

Global and Local Variables:

 Difference between global and local variable? Specimen Q3


o Global variable is visible throughout a program / may be
accessed from more than one part of the program (1),
whereas local variable is visible only in a module/construct
where it is created/declared.
 Why are global variables used? Specimen Q3
o Used when a value needs to be accessible from various parts
o It is the same value irrespective of where it is accessed
 Why are global variables avoided? Specimen Q3
o Global variables make it difficult to integrate modules,
o They increase the complexity of a program
o They may cause conflicts with names written by others/in
other modules
o They may be changed inadvertently when program is complex
 State what is meant by a local variable? 2023 Q5
o It can only be accessed within the subroutine/block in which it
is declared
 Give one benefit and one drawback of declaring dataArray as a local
variable in the main program. 2023 Q5
o Increases data integrity
o More efficient memory usage
o Stops other subroutines accidentally altering variable
o
o Cannot be processes directly by other subroutines
o It has to be passed into a subroutine as a parameter

Modularity, functions and procedures, parameter passing by value and


reference:

 Describe what is meant by a function? Sample Q4


o A function is a named section of program
o That performs a specific task
o It returns a value
o , it is often called inline
 Procedure vs Function? Sample Q4
o A procedure is also a sub-section of a program that performs a
specific task
o But does not necessarily return a value
o Most programming languages nowadays use functions
 Why is parameter passing into a function can be a better alternative
to using global variables? Sample Q3
o When a parameter is passed into a function, only a copy of the
data passed may be changed
o Therefore no unforeseen events will occur in other modules
o This is the case only if passed by value
 Advantages of a modular approach? 2016 Q6
o Work is easier to divide between a team
o Each team member just needs to know what values go into
their subroutine and the expected functionality
o Saves time as work takes place in parallel
o Each team member can work on their area of expertise
o Breaks problems into smaller areas
o Easier to test / debug / read
o Each subroutine can be tested before integration
o Code can be reused in the project / future projects
 Describe what is meant by passing a parameter by value and by
reference? 2018 Q1
o Passing by Value:
 A local copy of the data is used
 Data is discarded when the subprogram exits
 Does not override/change the original data
o Passing by Reference:
 Memory location of data is sent
 Changes are made to the original data
 Changes remain after the subprogram exits
 State the difference between parameter passing by reference and
parameter passing by value. 2022 Q2
o By reference will receive the memory location of where the
data / variable is stored
o By value will receive a copy of the data / variable.
 State two benefits of using reusable components when writing
program code. 2022 Q1
o Saves time (1) as code does not need to be rewritten (1)
o Code may already be tested (1) which will therefore save
development/debugging time (1)
o More efficient code (1) which will use less memory/be easier
to maintain
o May require less technical knowledge (1) as code can be used
rather than written (1).
 Explain the benefits of using subprograms to produce [this]
software?
o Allows for better efficiency
o As you can write once and call multiple times
o And it makes the code easier to read/debug
o Can reuse in other programs
o (Subroutines can be tested individually and then added to
main programs)

IDE:

 Describe what is meant by the term IDE (Integrated Development


Environment)? Specimen Q1
o A (single) program (1) used for developing programs (1) made
for a number of components (1).
 Describe three features commonly found in an IDE that will help
programmers to find any bugs in their code? Specimen Q1
o Debugging tools allow inspection of variable values. This can
allow run-time detection of errors.
o Code can be examined as it is running which allows logical
error to be pinpointed
o IDE debugging can produce a crash dump which shows the
state of variables at the point where an error occurs.
o It can display stack contents which show the sequencing
through procedures / modules
o It can step through code which allows the programmer to
watch the effects of each line of code
o The insertion of a break-point allows the program to be
stopped at a predetermined point in order to inspect its state
 Describe how the IDE could be used to create the Kidz Arrowz
program. 2018 Q2
o Provides a text editor / allows the code to be written
o Provides debugging tools. Allows the code to be written
o Provides a translator / compiler / interpreter / provides a run-
time environment / allows the code to run
o Description of key feature e.g colour coding keywords,
autocomplete, breakpoints e.c.t
 Describe three features that are commonly found in IDEs that will
help Sally write her program code? 2020 Q1
o Autocomplete (1) which will predict variable / built-in functions
(1)
o Auto indent (1) to automatically indent code when selection /
iterative statements are used (1)
o Colour coding (1) to be able to distinguish between the
different parts of each statement/line. (1)
 State the purpose of an IDE? 2022 Q1
o To write programming code
o To debug programming code
o To compile/interpret code

2.2.2 Software Development:

Test Strategies, including black and white box testing and alpha and beta
testing:

 Justify why Whitebox testing is used in the case of a factory that


produces hazardous chemicals? 2016 Q3
o The complete structure / logic has been tested
o Because it is safety critical e.g. chemical leak
o Potential impact on life
 Compare one difference between black box testing and white box
testing. 2020 Q1
o Black box is when the internal structure/design is not known to
the tester
o Black box requires limited/no programming knowledge
o White box testing is when the internal structure/design is
known to the tester
o White box requires programming knowledge
 2019 9 Marker
 Describe how black box testing can be used to test a program?
o Tests the expected output
o Based on input
o Does not look at the code / only looks at the program
specification
 Describe white box testing?
o White box testing is when you use the source code
o To test all the different possible paths through the program
o Trace tables are used

Software Development Methodologies:

 Sally uses a Rapid Application Development (RAD) approach when


creating her program. Describe two benefits of using RAD. 2020 Q1
o Reduced development time (1) due to time boxing / each
subtask being given a strict time limit. (1)
o Increases user involvement (1) so issues can be identified and
fixed early / more likely to meet client requirements (1)
o The requirements do not all need to be stated at the start (1)
so therefore it is more flexible (1)
 Describe the difference between the spiral model and the waterfall
model. 2023 Q2
o Spiral works on a small set of requirements …
o … waterfall starts with all requirements
o Spiral repeats from the start of the cycle each time…
o … waterfall to repeat needs a to reverse through previous
stages first
o Spiral focuses on risk mitigation …
o … Waterfall focuses on the delivery of the project as a whole
 Why is waterfall cycle not suitable? 2023 Q2
o The client needs the program quickly
o The client wants to be heavily involved
o The project is only small
o The project is low risk
 Name and describe one other model of software development?
2023 Q2
o Agile/rapid application development
o Building/use of prototypes
o
o Extreme programming
o Type of agile // has subsequent releases of new features
 Describe the Rapid Application Development Process?
o At the end of each cycle a prototype is created
o Feedback is then used to inform the next generation and any
changes are made
o The process repeats
o Until the prototype becomes the final product

2.3.1 Algorithms:

Binary Search:

 Describe the steps involved in a binary search to find the value 47 in


the list below. 2016 Q4
4, 7, 8, 21, 46, 47, 51
o Find the middle point in the list / 21 / element 4
o Compare it to the value 47, false
o Is 47 greater than the middle point, true, new subset is 46-51 /
change lower bound to 46 / element 5
o Find the middle of the new subset / 47 / element 6/ is this
value equal to 47, true, Search finishes
 Write a function to use a binary search to return a Boolean value.
The function should return True if the target integer is found in a list
of integers. Using pseudocode, write an algorithm for the function.
2016 Q4

 Binary search is efficient as it does not need to search every single


element/uses divide and conquer
 Choose one search algorithm and describe how this algorithm
works?
o Works on an ordered set of data
o Find mid-point
o If equal to midpoint, report found
o If less than midpoint, move lower bound 1 higher than the
midpoint
o If greater than mid-point, move upper bound 1 less than the
midpoint
o Repeat doing this until the value is found / sub-list is empty

Linear Search:

 Describe an alternative search algorithm (context makes it linear).


2016 Q4
o Perform a linear search
o Starting at the first element / each item is checked …
o Until value is found
o Or end of list is reached
 Choose one search algorithm and describe how this algorithm
works?
o Can work on both unordered and unordered
o Get first element
o If equal report found
o If not equal move to the next element
o Repeat for all the elements until the value is found / end of list
reached

Bubble Sort:

 Describe the disadvantages of using bubble sort? 2018 Q2


o Bubble sort is an inefficient algorithm …
o Meaning it will take more time/processing cycles to sort the
list
o Generally outperformed by insertion / quick / merge sort
o The item to be sorted is at the end of the list and so can only
move back one place per pass which is the worst scenario for
bubble sort
o These disadvantages are minimised by a small number
of items
 Write a procedure sortScores, to perform a bubble sort on the global
array scores to sort the players’ scores into descending order.

 Description of bubble sort taken from a 9 marker - 2018


o All adjacent items are compared against each other
o The biggest number in the adjacent pair is swapper over with
the smallest number. A temp variable is used to hold the data
whilst it is being moved.
o When a swap is made a flag is set
o This is repeated for all adjacent values, known as one pass.
o At the end of one pass, the largest item should appear at the
end of the list
o If at the end of the list the flag has been set the flag is unset
and the algorithm starts from the beginning of the list again
o When the algorithm gets to the end of the list and the flag is
unset the list is sorted.
 Show the first pass of bubble sort for “89, 25, 75, 37, 45”
 Show each stage of a bubble sort this data into ascending numerical
order. “1, 5, 3, 9, 2, 7” 2023 Q1

Data Structures/Types:

 Describe how an array can be used to store and access data in a


stack data structure. 2023 Q6
o (Stack) Pointer points to the last element added to the stack /
top of the stack
o New data is added to the pointer position // pointer + 1..,
o … check for overflow condition
o … pointer is then incremented
o Data is removed from pointer/pointer-1 position…
o … check for underflow condition
o … pointer is then decremented
o Elements can be accessed through push() and pop() methods
that are implemented
 State why a programmer might choose to declare a variable as a
floating point number?
o The variable may need to store decimal numbers
o To store very large/small values
 A priority queue is a data structure where each element is
associated with a priority, and elements with higher priority are
dequeued before those with lower priority. Queues are dynamic.
 Describe the steps involved in the enqueue algorithm?
o Check if the queue is full
o (by checking if the start and end pointers are equal)
o If the queue is full, return full
o Otherwise increment the end pointer
o And add the new item at the position indicated by the end
pointer
o (return added item)

Software Development:

Waterfall Cycle (4 marks)

The Waterfall model is a linear software development method where


each phase must be completed before moving to the next.
It begins with gathering all requirements, followed by design,
implementation, testing, and maintenance.
It’s best suited for projects with clearly defined requirements and
minimal expected changes.
However, it lacks flexibility, as going back to previous stages is
difficult once development has started.

Extreme Programming (XP) (4 marks)

Extreme Programming is an Agile methodology focused on improving


software quality through frequent releases and collaboration.
It involves techniques like pair programming, test-driven
development, and continuous integration.
Requirements can change at any time, making it highly adaptable to
user needs.
Frequent communication with the client ensures the product stays aligned
with expectations. – this is fundamental to agile software development in
general

Spiral Model (4 marks)

The Spiral model combines elements of design and prototyping in


stages, and places strong emphasis on risk assessment.
Each loop (or spiral) involves planning, risk analysis, development, and
evaluation.
It is suitable for large, high-risk projects, as risks are identified and
addressed early.
The project evolves through multiple cycles, allowing refinement at
each stage.
Rapid Application Development (RAD) (4 marks)

o RAD is a prototyping-based approach that prioritizes quick


development and frequent user feedback.
It uses time-boxed iterations to create working versions of
the software rapidly.
Each cycle produces a prototype that is evaluated and refined
based on user input.
This makes RAD ideal for projects where requirements may
change and user involvement is high.

At the end of each cycle a prototype is created


o Feedback is then used to inform the next generation and any
changes are made
o The process repeats
o Until the prototype becomes the final product

Alpha Testing (3 marks)

Alpha testing is the first phase of software testing, conducted internally


by developers or a dedicated testing team. It aims to identify bugs and
functionality issues before the software reaches external users. Testing
takes place in a controlled environment, often using simulated real-
world scenarios.

Beta Testing (3 marks)

Beta testing is the second phase, involving real users outside the
development team. It provides valuable feedback on usability,
performance, and unexpected bugs under real-world conditions. Beta
versions are usually released to a limited audience, allowing
developers to refine the software before the final release.

Testing stuff exists in a 9 marker - 2019

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy