Docsity
Docsity

Prepare for your exams
Prepare for your exams

Study with the several resources on Docsity


Earn points to download
Earn points to download

Earn points by helping other students or get them with a premium plan


Guidelines and tips
Guidelines and tips

CPSC 217 Midterm Exam Review With 100% Correct And Verified Answers 2024, Exams of Advanced Education

CPSC 217 Midterm Exam Review With 100% Correct And Verified Answers 2024 Compiler - Correct Answer-1. the whole file is turned into byte 2. The byte code is read by a python virtual machine, which executes the program python virtual machine - Correct Answer-executes a program interpreter - Correct Answer-1. the code is converted to byte 2. the code is executed line by line Algorithm - Correct Answer-A precise sequence of instructions for processes that can be executed by a computer Variables - Correct Answer-store data symbol to make a variable - Correct Answer-= integer - Correct Answer-positive or negative number with no decimals floating point number - Correct Answer-any number with decimals strings - Correct Answer-anything - numbers, letters, sentences, etc.

Typology: Exams

2024/2025

Available from 09/03/2024

Qualityexam
Qualityexam 🇰🇪

2.5

(4)

2.7K documents

1 / 4

Toggle sidebar

Related documents


Partial preview of the text

Download CPSC 217 Midterm Exam Review With 100% Correct And Verified Answers 2024 and more Exams Advanced Education in PDF only on Docsity!

CPSC 217 Midterm Exam Review With

100% Correct And Verified Answers 2024

Compiler - Correct Answer-1. the whole file is turned into byte

  1. The byte code is read by a python virtual machine, which executes the program python virtual machine - Correct Answer-executes a program interpreter - Correct Answer-1. the code is converted to byte
  2. the code is executed line by line Algorithm - Correct Answer-A precise sequence of instructions for processes that can be executed by a computer Variables - Correct Answer-store data symbol to make a variable - Correct Answer-= integer - Correct Answer-positive or negative number with no decimals floating point number - Correct Answer-any number with decimals strings - Correct Answer-anything - numbers, letters, sentences, etc. symbol for string - Correct Answer-"____" Variable naming convention - Correct Answer-Camel casing Constants - Correct Answer-variables that will never be updated symbol for constant - Correct Answer-ALL CAPS magic number - Correct Answer-numbers without context Operators - Correct Answer-represent math multiplication symbol - Correct Answer-* add symbol - Correct Answer-+ subtract symbol - Correct Answer-- division symbol - Correct Answer-/

exponent symbol - Correct Answer-** integer division definition - Correct Answer-gives only whole numbers integer division symbol - Correct Answer-// remainder division definition - Correct Answer-returns the remainder of a division remainder division symbol - Correct Answer-% what happens to a variable when the program ends? - Correct Answer-it ceases to exist. bye. when using an input function, how is the data stored - Correct Answer-string syntax error - Correct Answer-structure of the program is wrong, program won't run runtime error - Correct Answer-program runs, but errors are exposed when it does logic error - Correct Answer-the program is doing what you told it to do but you're wrong comment symbol - Correct Answer-# purpose of libraries - Correct Answer-import code written by other people import statement w/o changing the name - Correct Answer-import math import statement changing the name - Correct Answer-import math as mt format function - Correct Answer-easier way to put variables into a print function format function symbol - Correct Answer-"{}".format(variable) format function example - Correct Answer-print ("hello {}, your favourite colour is {}".format(name, age)) boolean - Correct Answer-a variable that is either true or false binary data type - Correct Answer-only 2 possible values True as an integer - Correct Answer- False as an integer - Correct Answer- symbol for equal to - Correct Answer-==

difference between = and == - Correct Answer-1. codes a variable

  1. equal to and statements - Correct Answer-False unless all are true or statements - Correct Answer-True unless all are false not statements - Correct Answer-takes the opposite of what you said if you have x variables, how many possible results will be on the truth table - Correct Answer-2^x Loops definition - Correct Answer-performing a task as many times as we choose characteristics of a loop - Correct Answer-loop condition loop body loop control loop condition - Correct Answer-what has to happen for the loop to happen loop body - Correct Answer-the task that is repeated loop control - Correct Answer-how the loop is started and stopped infinite loops - Correct Answer-bad pre-loop test - Correct Answer-check the condition before running the code minimum times a loop will run with a pre-loop test - Correct Answer-zero post loop test - Correct Answer-check the condition after running the code block minimum times a post-test loop will run - Correct Answer-one type of loop supported by python - Correct Answer-pre-test loop while loop - Correct Answer-as long as the condition is met, the loop will run change in variable symbol (while loop) - Correct Answer-+= For loops - Correct Answer-for variable in range do this do you need brackets for a range function - Correct Answer-yes values of x, y, z in range (x,y,z) - Correct Answer-x = start y = stop

z = step define step value (range function) - Correct Answer-how much it increases by what is x in range(x) - Correct Answer-stop value what are x and y in range (x, y) - Correct Answer-x = start y = stop type of loop for continuous user input - Correct Answer-while loop type of loop that the loop control can be increased by a decimal - Correct Answer-while loop loop control is automatically updated - Correct Answer-for loop define data - Correct Answer-information without context define encoding - Correct Answer-mapping information to data