Skip to content
This repository was archived by the owner on Sep 12, 2025. It is now read-only.

Lab 3.04 what is it supposed to do? #410

@Dan-TEALS

Description

@Dan-TEALS

Discussed in #363

Originally posted by jdonwells March 1, 2022
Lab 3.04 has sections Problem 1, Problem 2, Problem 3. Students are asked to decide if there is a problem in the code. But we never tell them what the code is supposed to do.

The example itself seems a bit contrived. I can't imagine anyone writing something like that. This is a bad example to have students study. Let's not do that.

For anyone trying to figure out what we are trying to show them:

  1. We are creating local variables in the function named the same as the global variables, but they are assigned after reference.
  2. We are creating local variables named the same as global variables, but they seem to be assigned the wrong values.
  3. We are using the global variables in the function such that your favorite pet is always cat.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions