Save
Busy. Please wait.
Log in with Clever
or

show password
Forgot Password?

Don't have an account?  Sign up 
Sign up using Clever
or

Username is available taken
show password


Make sure to remember your password. If you forget it there is no way for StudyStack to send you a reset link. You would need to create a new account.
Your email address is only used to allow you to reset your password. See our Privacy Policy and Terms of Service.


Already a StudyStack user? Log In

Reset Password
Enter the associated with your account, and we'll email you a link to reset your password.
focusNode
Didn't know it?
click below
 
Knew it?
click below
Don't Know
Remaining cards (0)
Know
0:00
Embed Code - If you would like this activity on your web page, copy the script below and paste it into your web page.

  Normal Size     Small Size show me how

COMPUTER SCIENCE 2.2

Unit 2.2 Programming techniques Pseudo code and vocabulary

TermDefinition
DIV (floor division, quotient) Integer division
MOD Provides the remainder
Concatenation Joining strings together PS: string_1 + string_2 etc.
Length of string PS: string_name.length P: Len(string_name)
Substring PS: string_name.subString(start pos, no. characters)
Declaring an array PS: array_name(items separated by commas)
accessing an item in an array PS: print(array[position])
length of an array PS: array_length=array_name.length
Declaring a 2D array PS: array array_name(rows, columns)
Accessing data in a record PS: array_records[index].filename
Changing data in a record PS: array_records[index].filename = data (what to overwrite)
SQL Structured Query Language
SELECT Which record or row to take data from
FROM Which array/ field to take data from
WHERE Under what conditions should the record be chosen/returned?
Random number generation PS: num <-- RANDOM_INT(1,6) P: import random dice = random.randint(1,6)
Sub programs Smaller sections of code embedded into the main program
Procedures Carry out a task and provide structure to code.
Functions Carry out a task and return values to be used in the main program. Can be used to create re useable program components.
Array A variable with a single identifier that can store multiple items of data (of the same data type), and includes an index (position).
Variable Items of data that can change while the program is running. (reserves an area of memory to store its contents)
Constant a value that cannot change while the program is running but still uses an identifier name.
Decleration Stating the names of the variable to be used. Need to identify the data type.
Assignment setting the value of a variable/constant
Programming construct a way of building/ constructing code.
Sequence The order that things happen, running the program from start to finish
Selection choosing between possible actions through 'if' statements
Iteration repeating actions using loops (FOR or WHILE)
Counter controlled iteration set number of repeats using a FOR loop.
Condition controlled iteration repeats a set of actions while the condition is true using WHILE loops.
Operator a character/ characters that determine the action or process.
Exponentiation indices (using ^)
Casting converting from one data type to another
Text file contains plain text with no formatting to store data. can be read from and put into RAM.
Delimiter Separates data (usually with a comma) in a line.
Line numbers start at one but not stored in the text file
Procedure code PS: procedure name (...) ... end procedure
Calling a procedure PS: procedure(parameters)
Function code PS: function name(...) ... return ... end function
Calling a function PS: function(parameters)
Functions in python def function_name(): ...
Reading text files myFile = openRead(filename) file data = myFile.readLine() myFile.close()
Why do you always have to close a file? So other users can access it and to save RAM space.
Reading files into an array for line = 1 to 6 array_name[line -1] = myFile.readLine() next line myFile.close()
reading a whole file for line 1 to 41 filedata = myFile.readLine() print(file data) nextline myFile.close()
writing to a text file myfile = openWrite(filename) myFile = writeLine(data) myFile.close()
write a line into CSV data_for_file = ''...,'' + variable + etc. filename.writeLine(data_for_file)
Creating files createFile(filename)
Open file myFile = openRead() myFile = openWrite()
close file myFile.close()
Created by: Fox_2024
Popular Computers sets

 

 



Voices

Use these flashcards to help memorize information. Look at the large card and try to recall what is on the other side. Then click the card to flip it. If you knew the answer, click the green Know box. Otherwise, click the red Don't know box.

When you've placed seven or more cards in the Don't know box, click "retry" to try those cards again.

If you've accidentally put the card in the wrong box, just click on the card to take it out of the box.

You can also use your keyboard to move the cards as follows:

If you are logged in to your account, this website will remember which cards you know and don't know so that they are in the same box the next time you log in.

When you need a break, try one of the other activities listed below the flashcards like Matching, Snowman, or Hungry Bug. Although it may feel like you're playing a game, your brain is still making more connections with the information to help you out.

To see how well you know the information, try the Quiz or Test activity.

Pass complete!
"Know" box contains:
Time elapsed:
Retries:
restart all cards