



Étudies grâce aux nombreuses ressources disponibles sur Docsity
Gagnz des points en aidant d'autres étudiants ou achete-les avec un plan Premium
Cette page n'est pas visible dans l'aperçu
Ne manques pas les parties importantes!




Life cycle of programming Parts of analysing ● Abstraction - removes any unnecessary parts and keeping all relevant ideas which simplifies the problem ● Decomposition - breaking down the system into simpler smaller parts so that it can be easily understood of process input output storage ● Identification of problems - specifying the processes, input, output and storage Design Details of solution Can be represented as ● structure diagrams ● flowcharts ● pseudocode Coding Program is being developed Testing Program is being tested for errors
Type of variables Global
● allows subroutine to be reused for different data
Files Reasons for storing data in a file: Stores permanently Can be reused at a later time Can be transferred and use on another computer
Test Data ● Normal - Data is accepted ● Abnormal - Data is rejected ● Extreme - Data that is the maximum or minimum value in the range that can be accepted ● Boundary - Data that includes the maximum and minimum value of data can be accepted or rejected. It is just like extreme but it includes the data that is rejected Extreme and boundary are used to test the limits of acceptable data entry
Data types * *(Dont confuse with TEST data types they are different) In programs: ● Integers - whole numbers ● Real - contains fractional part ● String - combination of letters numbers and special characters ● Boolean - only two values of true and false ● Char - single letter
In databases: ● Integer ● Real ● Text - same as string ● Boolean ● Char ● Date/Time
How to make programs better ● Add meaningful identifiers so programmers can understand their purpose ● Add comments so programmers know how the code works ● Use subroutines
Flowcharts
● COUNT(Field) - counts number of records that fits the criteria
Validation Checks ● Range checks - Accepts value that is between an upper and lower value ● Length checks - Accepts data if number of characters is within accepted range ● Type check - accepts data if it is of correct data type ● Presence check - accepts data if it has been entered and rejects if left blank ● Format check - characters has to be entered in a specific pattern Verification Checks ● Visual Check - Manual check to see if data matches as seen on form ● Double Entry - Data is entered twice and then compared and if it matches it is accepted
Pseudocode DECLARE variable: DATATYPE DECLARE list: ARRAY[1:5]OF DATATYPE // for array with 5 elements
PROCEDURE {identifier} (parameters:data type, parameter2:data type) statements ENDPROCEDURE
FUNCTION {identifier} (parameters:data type, parameter2:data type) RETURNS {data type} statements ENDFUNCTION LENGTH (finding number of characters in a string) SUBSTRING (taking out a part of a string)- example SUBSTRING (hello,3,3) would be llo UCASE (convert all letters to uppercase a -> A) LCASE (Convert all letters to lowercase A -> a) MOD (Remainder after division) DIV (divide a value (by an integer only)) ROUND (Returns a value rounded to a certain number of decimal places) RANDOM (returns a random number)
// comment
OPEN (filename) FOR READ/WRITE - gives access to a file to read/write READ (filename),(variable) - retrieves data from the file WRITE (filename),(variable) - stores data in the file CLOSE (filename)
NEXT Index Bubble sort Last <- LENGTH(Array) REPEAT Swap <- False FOR Index <- 1 TO Last - IF Array[Index]>Array[Index + 1]THEN Temp<- Array[Index] Array[Index]<-Array[Index+1] Array[Index+1]<-Temp Swap <- True ENDIF NEXT Index Last<- Last - UNTIL NOT Swap OR Last=
Good luck for tmrw gng :p