Software design and development

0.0(0)
studied byStudied by 1 person
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
Card Sorting

1/12

flashcard set

Earn XP

Description and Tags

Computer science

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

13 Terms

1
New cards

Formal vs Actual parameters

Formal parameters are in the sub-programs DEF line.

Actual Parameters are passed into the sub-program.

2
New cards

Local vs Global variables

Local are defined within the sub-program.

Global are defined in the main program.

3
New cards

Function vs Procedures

A function returns a value (For example:

def calc_circumference(radius):

Circumference = 2 × 3.14 * radius

return circumference)

A procedure produces an effect. (For example:

def display_welcome(name):
print( “Hello” + name))

4
New cards

Substrings

You can shorten strings of text using substrings. Example:

message = hello world

print(message[0:5]) = hello

This happens because the position of the string starts at 0 instead of 1 so the 5 letters would be “hello”.

5
New cards

converting characters to ASCII

ascii_code = ord(“A”)

6
New cards

converting ASCII to characters

new_char = chr(90)

7
New cards

Find min/max algorithm

*Find max below.

max = 0

for count in range (0,len(scores)):

…If scores[count] > scores[max]]:

……max = count

*Dots are supposed to be spaces. I have to use them so I don’t activate that fuck-ass AI.

*Same for find min just use the less than symbol (<)

8
New cards

Linear search

searchTerm = 80

for count in range (0,len(scores)):
If scores[count] == searchTerm:
print(searchTerm , “Found at position” , count)

print(“Search complete”)

9
New cards

Count occurences

search = 80

hits = 0

for count in range (0,len(Scores)):
if scores[count] == search:
hits = hits + 1

print(search , “has been found” , hits , “times.”)

10
New cards

Analysis

Purpose - A general description of the software.

Scope - A list of deliverables given to the client at the end of a project.

Boundries - What the program can’t do.

11
New cards

Scope of a variable

Section of code in which a variable is accessible/usable

12
New cards

Record structures

class className():

. def_init_(self):

. self. thing1 = “ “

. self. thing2 = 0.0

13
New cards

Writing to a file

fileWrite = open(“output.csv” , “w”)

for count in range (0, len(data)):
fileWrite.write(thing1[count] + str(thing2[count]) + “/n”)

file.close()

*The str in front of thing 2 is there because if its an integer it will try to add itself mathematically.

*The /n is there so the next write goes to a new line.