Intro to Programming Logic Flashcards
What is a Sequence?
Statements executed one after another.
What is a Selection?
Statement used to make a decision.
What is a loop?
Statement used to repeatedly execute a section of code.
What are 3 basic software structures?
Sequence, Selection, and Loop
What does a declaration do?
Reserves an area of memory to hold computer data for a Variable. It also assigns this Variable a “Type” - ie String vs. Number
What does an Assignment Statement do?
Stores a value in a variable, Value may be the result of a calculation.
What does an Input Statement do?
Gets a value from the user and stores it as a variable.
What does an Output Statement do?
Displays information to the user (Including values of variables.)
What should be included in a comment?
~What does the program (or section of the program) do?
~Who wrote the program?
~When was it written?
~Who owns the program?
~Explains a complicated section of code
What are attributes of Strongly Typed Languages? Examples?
~Must indicate variable type in declaration
~Variable only stores the type of date declared
~Can NOT store different type data in the variable (programming error)
Strongly-typed programming languages: Flowgorithm, C, C++, C#, Java
What are attributes of Weakly Typed Languages? Examples?
Must declare variable, but type not required.
Variables can store different types of data.
Weakly-typed programming languages: Python, JavaScript, PHP
What is Pseudo-
code?
Informal English-Like code that implements an algorithm.
What is an algorithm?
A set of steps designed to solve a particular problem.
What is the software developments lifecycle?
Requirements Analysis, Design, Implementation, Testing, Deployment/Maintenance
What is Requirement Analysis?
It’s the first step in the Software Development Lifecycle that determines what the software should do to meet the needs of the customer
What is Design in the SDLC?
This is the second step meant to define and document a plan for the implementation of Software.
What is Implementation in the SDLC?
This is the third step meant to code the software using a programming language.
What is Testing in the SDLC?
This is the fourth step meant to verify the software is free from defects and conforms to the requirements.
What is Deployment/Maintenance in the SDLC?
This is the fifth step meant to release the software and provide ongoing support.
Describe a Boolean Expression.
Boolean Expressions result as True or False. They can calculate with literals (True or False) and Variables used in a comparison.
What does a “While” loop do?
Tests a Boolean condition and repeats a section of code as long as the condition remains true.
What is an indefinite “While” loop and how do you end them?
A loop that will execute an unknown amount of times. Code in a Sentinel Value and advise the user how to use it.
What is a Sentinel Value?
A coded value that can end an indefinite “While” loop.
What is an infinite “While” loop?
A loop that goes on forever usually due to a bug.
What is a “Do While” loop?
A loop that checks the control variable after executing, ensuring it always runs at least once.
What is a “For” loop?
A more compact way to create definite/indefinite counters.
What are the stages of the “Instruction Cycle” for a processor?
Fetch, Decode, Execute, Repeat
What is a bit?
A single Binary Digit of information (0 or 1)
What is a Byte?
Eight bits; can represent a number 0-255 or 1 letter.