Complete Revision Theory Software Develeopment

Views:
 
Category: Entertainment
     
 

Presentation Description

No description available.

Comments

Presentation Transcript

Software Development Revision Quiz:

Software Development Revision Quiz Df27 11

The software development lifecycle:

The software development lifecycle Analysis, Design, Implementation, Testing, Documentation, Evaluation Maintenance A D ance I n T he D ark E very M onday

Two stages are missing from the software development lifecycle analysis, design, X, testing, documentation ,evaluation, Y Choose the option that correctly identifies the missing stages:

Two stages are missing from the software development lifecycle analysis, design, X, testing, documentation ,evaluation, Y Choose the option that correctly identifies the missing stages X = testing, Y= maintenance X = coding, Y= feedback X = coding, Y= maintenance X = Implementation, Y= feedback X = Implementation, Y= maintenance

Match the stages of the SDLC to the actions:

evaluation documentation analysis implementation testing Ensuring the program is fit for purpose Agreeing on the program specification Checking whether the program is readable Writing instructions for the users of the program Code is compiled into machine code Match the stages of the SDLC to the actions

A structure diagram may be created in the design stage of the SDLC:

A structure diagram may be created in the design stage of the SDLC

Software is readable if it can be understood by another programmer:

Software is readable if it can be understood by another programmer

Testing Software:

Testing Software

Testing:

Testing is running a software program and testing it with a variety of inputs to see if the results are what you expect. A program cannot be tested for every possible input. Careful selection of test data is very important. We normally test with valid data NORMAL Data on the limits EXTREME Invalid data EXCEPTIONAL Testing

A program has been written which records marks out of 10. The code is testing by inputting -1, x and 11. These are examples of ::

A program has been written which records marks out of 10. The code is testing by inputting -1, x and 11. These are examples of : Incomplete test data Normal test data Extreme test data Complete test data Exceptional data

A program has been written to check that a number is between 11 & 18. The program is being tested with inputs of 11,14,18. This is an example of :

A program has been written to check that a number is between 11 & 18. The program is being tested with inputs of 11,14,18. This is an example of Exceptional test data Incomplete tesa data Complete test data Normal test data Extreme test data

Software Development Languages and Environments :

High Level Language Machine Code Software Development Languages and Environments

Machine Code:

Machine code is the only code that the processor understands and is: Written in 1s and 0s (binary) Very hard for humans to understand Very hard to spot mistakes and to make changes Specific to a processor Machine Code

High Level Language:

Most programmers will use a high level language to write their code because they are: Written in English-like language Easy to learn Easy to understand, make changes and spot mistakes Can be transferred between different types of computer BUT processors do not understand high level languages To solve the problem of processors not understanding high level languages, a program called a translator is used. High Level Language

Translator:

A translator is used to convert a high level language into machine code (low level language ). There are two types of translator: Interpreter Compiler Translator

Interpreter VS Compiler :

Interpreter Translates one line at a time Gives accurate error messages where the error occurs Easier to spot/edit mistakes BUT every time code is run you must use the interpreter Compiler Compiles whole code in one go therefore faster than interpreter Only needs to be compiled once and produces object code Can be harder to spot/edit mistakes Interpreter v Compiler An interpreter is used for program development as it is easier to debug and partially test the code. Once the program is error free and complete, the program should then be compiled, as compiling only needs to be done once. Interpreter VS Compiler

Macros :

A macro is a small program which is developed within an application package to carry out a complex task in one keystroke. Advantages of a Macro Saves time by automating tasks Can enhance packages by adding commands to suit the users needs Simplifies repetitive actions Features of a Macro Only works within an application package Can be edited to suit program/task Can be created by recording a sequence of keystrokes and assigning them to a key or a combination of keys Can also be created by using a scripting language Macros

Text Editors :

Text Editors A text editor is similar to a basic word processor and allows the programmer to enter their high level language code. Features of a Text Editor Enter and edit text Copy and paste facility Search and replace facility Different colours for command words and internal commentary Text Editors

A program which translates high level language into machine code line by line is :

A program which translates high level language into machine code line by line is A text editor psuedocode An algorithm A compiler An interpreter

A macro is a :

A macro is a A pre-defined function a program that cannot be edited A program that converts high level language into machine code A program that is written in machine code A set of commands activated by a keystoke

A software developer wants to convert an entire high level program to machine code. This could be done using :

A software developer wants to convert an entire high level program to machine code. This could be done using A pre-defined function an interpreter A macro A text editor A compiler

High Level Programming Language Constructs :

High Level Programming Language Constructs

Variables When programming, it is necessary to tell the program what type of data is expected. This is known as declaring variables.:

Variables When programming, it is necessary to tell the program what type of data is expected. This is known as declaring variables .

Arithmetic Operators :

Arithmetic Operators Normal mathematical symbols are used for calculations. Arithmetic + Add - Subtract * Multiply / Divide to the power of, e.g. 4 2 =16

Logical Operators :

Logical Operators AND means all facts must be true OR means at least 1 fact must be true NOT means the opposite of

Loops :

Loops In programming loops are used to repeat an instruction or group of instructions . There are several different kinds..

Fixed Loop :

Fixed Loop A fixed loop is used when the programmer knows at the start how many times the loop has to run. For counter = 1 to 5 Print "Hello" Next Would print the word Hello 5 times

Nested Loop :

Nested Loop A nested loop is where one loop is placed inside another loop. For counter = 1 to 4 Do Make(counter) = Inputbox ("Please enter make of car") If Make(counter) = "Ford" then MsgBox ("We do not accept Ford cars") Loop until Make(counter) <> "Ford" Next model This code contains a loop within a loop. The first loop asks for the make of a car to be entered 4 times. Within this loop another loop validates the input by not accepting Ford cars.

Nested Loop :

Nested Loop A nested loop is where one loop is placed inside another loop. For counter = 1 to 4 Do Make(counter) = Inputbox ("Please enter make of car") If Make(counter) = "Ford" then MsgBox ("We do not accept Ford cars") Loop until Make(counter) <> "Ford" Next model This code contains a loop within a loop. The first loop asks for the make of a car to be entered 4 times. Within this loop another loop validates the input by not accepting Ford cars.

Conditional Loops :

Conditional Loops A conditional loop repeats until a condition is met, e.g. we don't know how many times the loop must run until the condition is met. number = Inputbox ("Please enter a number between 1 and 50") While number <0 OR number > 50 Inputbox ("Number must be between 1 and 50. Please re-enter.") End While This code asks for a number between 1 and 50 and will loop continually until a number between 1 and 50 is entered.

Conditional Statement :

Conditional Statement A conditional statement is how the program can make a decision. These are also known as an IF statement. These decisions rely on testing at least one condition.

Conditions :

Conditions A condition is simply a statement or sum that is either true or false. A simple condition only requires one statement or sum to be true. Example Name = Derek Age = 60 A complex condition requires two or more statements or sums to be true. Example Forename = Derek AND Surname = Park Age = 60 AND Status = Old

Arrays :

Arrays Arrays allow us to store a list of items. An array is a collection of data that is all of the same type. Like any variable, an array must be declared before it is used. Advantages of an array An entire array can be declared all at once. Each individual element in the array can be referenced by indexing. Arrays allow us to reduce the number of variables required and make the program easier to read. For example: If we wanted to store the names of 4 people we would normally have to declare them as: Dim name_1 as String Dim name_2 as String Dim name_3 as String Dim name_4 as String But with an array we can declare them as: Dim name(4) as String If we wish to refer to the second name in the array we would call it name(2) . Name is the variable and (2) is the index .

Pre-defined Functions :

Pre-defined Functions Programming languages usually have a lot of predefined functions which allow the program to do calculations, format values, manipulate text etc. Examples of Predefined Functions INT takes a number and removes any fractional part, leaving the whole number part. ROUND takes a number and returns the nearest whole number. SQR returns the square root of any number. LEN returns the length of a specified string

Standard Algorithms:

Standard Algorithms There are 5 different algorithms in common use, these are used by programmers repeatedly in many different situations. Input validation Finding Minimum Finding Maximum Counting Occurrences Linear Search

Input Validation:

Input Validation Checking data that has been input into a computer is sensible (or within a certain range) for example, months of the year - between 1 and 12 OR percentage test marks - between 0 and 100 If a mark of 101 is entered then the program should reject this mark and ask the user to re-enter a mark in the range 0 and 100. Studentmark = Inputbox ("Please enter a number between 1 and 100") While Studentmark <0 OR number > Studentmark Studentmark = Inputbox ("Mark must be between 1 and 100. Please re-enter.") End While

Finding Minimum:

Finding Minimum This algorithm will find the smallest number in a list for example the fastest swimmer in a race OR the smallest shoe size of all pupils in a class.

Finding Maximum:

Finding Maximum This will find the largest number in a list for example the highest mark in a class test OR the highest temperature in a month

Counting Occurrences:

Counting Occurrences Counting how many times a value appears in a list or array for example, pupils in a secondary class who went to a certain Primary School OR pupils with blue eyes in class.

Linear Search:

Linear Search Finding a value in a list or array for example searching a list of names.

Which one of the following would be the most suitable for storing student names in a class of 30:

Which one of the following would be the most suitable for storing student names in a class of 30 A string An array of numbers 20 numeric variables 30 string variables An array of strings

A fixed loop is :

A fixed loop is Is repeated just once Contains a conditional statement Is a loop inside another loop Is repeated until a given condition occurs Repeated a known number of times

Pseudocode Example:

If hours >40 rate = 2 If hours is greater than 35 and less than 40 rate = 1.5 If hours is greater than 2 and less than or equal to 35 rate = 1 If hours is less than 2 rate = 2 Use this pseudocode to answer following 3 questions on slides 43,44, 45 & 46 Pseudocode Example

If hours > 2 and less than 35 is an example of:

If hours > 2 and less than 35 is an example of An algorithm A macro A pre-defined statement A complex condition A simple condition

What is the value of rate if hours has a value 35:

What is the value of rate if hours has a value 35 0 2.5 2 1.5 1

What is the value of rate if hours has a value 36:

What is the value of rate if hours has a value 36 0 2.5 1 1.5 2

What is the value of rate if hours has a value 1:

What is the value of rate if hours has a value 1 0 2.5 1 1.5 2

A program will issue a young person ‘s card if the age entered is equal to or over 18 and under 25. Which one of the following conditions should be entered in the program:

A program will issue a young person ‘s card if the age entered is equal to or over 18 and under 25. Which one of the following conditions should be entered in the program Age >18 AND age>25 Age < 18 AND age>=25 Age >=18 AND age<=25 Age >18 AND age<=25 Age >=18 AND age <25

A program will issue a young person ‘s card if the age entered is equal to or over 18 and under 25. Which one of the following conditions should be entered in the program:

A program will issue a young person ‘s card if the age entered is equal to or over 18 and under 25. Which one of the following conditions should be entered in the program Age >18 AND age>25 Age < 18 AND age>=25 Age >=18 AND age<=25 Age >18 AND age<=25 Age >=18 AND age <25

State one benefit of a user defined function:

State one benefit of a user defined function

The below pseudocode is an example of which algorithm Loop Input data If data is not within allowed range, prompt user to re-enter data Until data is within allowed range :

The below pseudocode is an example of which algorithm Loop Input data If data is not within allowed range, prompt user to re-enter data Until data is within allowed range Input Validation

A program has been written to find the highest salary in a postcode. Which one of the following standard algorithms would be used as apart of the program :

A program has been written to find the highest salary in a postcode. Which one of the following standard algorithms would be used as apart of the program Find minimum Input validation Linear search Count occurrences Find maximum

authorStream Live Help