100% satisfaction guarantee Immediately available after payment Both online and in PDF No strings attached
logo-home
CPSC 231 Midterm || with 100% Errorless Solutions. $11.29   Add to cart

Exam (elaborations)

CPSC 231 Midterm || with 100% Errorless Solutions.

 1 view  0 purchase
  • Course
  • CPSC 231
  • Institution
  • CPSC 231

Loops correct answers A loop is used to repeat code in your program. while loop correct answers a programming construct used to repeat a set of commands (loop) as long as (while) a boolean condition is true for loop correct answers A particular kind of looping construct provided in many langu...

[Show more]

Preview 2 out of 9  pages

  • October 27, 2024
  • 9
  • 2024/2025
  • Exam (elaborations)
  • Questions & answers
  • CPSC 231
  • CPSC 231
avatar-seller
FullyFocus
CPSC 231 Midterm || with 100% Errorless Solutions.
Loops correct answers A loop is used to repeat code in your program.

while loop correct answers a programming construct used to repeat a set of commands (loop) as
long as (while) a boolean condition is true

for loop correct answers A particular kind of looping construct provided in many languages.
Typically, a for loop defines a counting variable that is checked and incremented on each
iteration in order to loop a specific number of times.

loop control correct answers Allows us to execute a statement or group of statements multiple
times.

While: Repeats a statement or group of statements while a given condition is true. It tests the
condition before executing the loop body.

For: Execute a sequence of statements multiple times and abbreviates the code that manages the
loop variable.

loop body correct answers Any number of statements nested inside a loop. The nesting is
indicated by the fact that the statements are indented under the for loop statement. Refers to the
code that needs to be executed repeatedly.

post-test loop correct answers The loop control is checked after executing the loop body.
The loop executes at least once.
Python does not have any.

pre-test loop correct answers Checks for the condition to be true before the loop begins giving
the possibility that it never goes through the loop once.
The loop executes zero or more times.
In python (for, while) loops.

loop when you know how many times to repeat correct answers for loop

range correct answers A function that can take up to three parameters
(start, end, step)
The only parameter that is necessary is the end/stop parameter.
The start parameter is where you would like the range to start, if nothing is entered it is
automatically 0.
The stop parameter is where the range would stop and is already excluded from the range. Ex 0-6
if the parameter entered was 6 it would only go from 0-5.
Step: Represents the increment value, default is 1.

break correct answers Entire loop ends immediately, execution continues at the first statement
after the loop body, using "break" is not good coding practice.

, continue correct answers current iteration ends immediately, execution returns to the top of the
loop, in a for loop the next item on the list is used.

nested loop correct answers A loop that is inside the body of another loop

infinite loop correct answers When the looping condition is always satisfied, the loop never ends.
Caused by a logical error; the loop control does not get updated or the update results in satisfying
the loop condition.

Erroneous loop correct answers The loop condition is not met before entering the loop.

Tracing code correct answers Examine each statement in sequence, perform whatever task the
statement requires, recording values of interest.
Result of this could be the value of one or more variables, or the output generated.
Very important skill for debugging!

Criminal code of Canada computer system definition correct answers A device that, or a group of
interconnected or related devices one of more of which;
1. Contains computer programs and or other data and
2. May perform other functions.

computer program criminal code definition correct answers Data representing instructions or
statements that, when executed in a computer system, causes the computer system to perform a
function.

UCITA (Uniform Computer Information Transactions Act) computer definition correct answers
An electronic device that accepts information in digital or similar form and manipulates it for a
result based on a sequence of instructions.

Other computer definitions correct answers 1. One who computes
2. A tool that receives, processes and presents data.
Computers dont have to electronic they can be mechanical, biological, optical etc.

abacus correct answers a calculator that performs arithmetic functions by manually sliding
counters on rods or in grooves. One of the first computing devices

ENIAC (Electronic Numerical Integrator and Computer) correct answers Electronic Numerical
Integrator and Computer (ENIAC) is the first fully electronic digital computer. Could be
programmed to solve a range of problems (computing tool). Originally intended for generating
artillery firing tables, but WW2 ended before the ENIAC was completed in 1945. It cost 0.5
million $. Consists of 17468 vacuum tubes, 1500 relays, 70000 resistors, 10000 capacitors about
5 million soldier points. Required 150 kW of power. Could perform 5000 additions per second,
385 mults, 40 divides and 3 square roots.
Ran for 10 years, tube failed every 2 days (15 min to find). Computer History Museum has
pieces of machines from this generation.

The benefits of buying summaries with Stuvia:

Guaranteed quality through customer reviews

Guaranteed quality through customer reviews

Stuvia customers have reviewed more than 700,000 summaries. This how you know that you are buying the best documents.

Quick and easy check-out

Quick and easy check-out

You can quickly pay through credit card or Stuvia-credit for the summaries. There is no membership needed.

Focus on what matters

Focus on what matters

Your fellow students write the study notes themselves, which is why the documents are always reliable and up-to-date. This ensures you quickly get to the core!

Frequently asked questions

What do I get when I buy this document?

You get a PDF, available immediately after your purchase. The purchased document is accessible anytime, anywhere and indefinitely through your profile.

Satisfaction guarantee: how does it work?

Our satisfaction guarantee ensures that you always find a study document that suits you well. You fill out a form, and our customer service team takes care of the rest.

Who am I buying these notes from?

Stuvia is a marketplace, so you are not buying this document from us, but from seller FullyFocus. Stuvia facilitates payment to the seller.

Will I be stuck with a subscription?

No, you only buy these notes for $11.29. You're not tied to anything after your purchase.

Can Stuvia be trusted?

4.6 stars on Google & Trustpilot (+1000 reviews)

75759 documents were sold in the last 30 days

Founded in 2010, the go-to place to buy study notes for 14 years now

Start selling
$11.29
  • (0)
  Add to cart