| |
 |

 |
|
|
Featured
Lessons and Activities
-
Content
Lessons |
 |
Arrays, Strings,
Scope, and Other Magic Stuff
A Freshman Engineering Computer Programming Lab
Developed by Dr. P.K. Imbrie, Purdue University
Click here for the PDF version of
the lesson

Overview:
In this lab, students will be learning about computer
programming using the C programming language. The goal of
this lab is to provide students with exercises that
accelerate learning of fundamental computer programming
materials through repetitive practice and through looking at
programming from more than one angle.
Learning Objectives or Student
Outcomes:
By the end of this lab, students will be able to
1. demonstrate an understanding of increment and decrement
operators as well as the prefix and postfix uses of these;
2. use a given code in a program to increase their
understanding of operators;
3. add blocks of code to a program using the increment
operator;
4. write a main program that will prompt a user for a
magnitude and an angle (in degrees) for a vector, pass the
angle (in degrees) and the magnitude to a function through
the argument/parameter list;
5. define a 10-element single
subscripted integer array that is initialized (via the
declaration statement) to contain the numbers 1 through 10
in elements 0 through 9, respectively;
6. run a given code within a main program, and, then, after
seeing what happens, alter the code to make it more clear;
7. write a flowchart for an algorithm that will ask a user
to enter all the elements for two real matrices;
8. develop a simple test case by hand to ensure that your
algorithm works before you attempt to actually write a
program; and
9. verify their algorithm and convert it to an appropriate C
program. |
Length of Lesson:
Four to six hours of in-class time, including any pre- and
post-activity discussions.
Prior Knowledge to Ensure Student Preparation:
Prior to participating in this lab, students must have some
kind of knowledge of C programming—particularly the
increment and decrement operators as well as the prefix and
postfix uses of these; adding blocks of code to programs;
writing programs; arrays; running and altering given code;
writing and verifying algorithms, and converting those
algorithms to a C program.
Mention of this prior knowledge or classroom instruction is
indicated by notes within the lesson.
Team Size/Composition:
Teams of 4 work best; if necessary, a few teams of 3 or 5
students may be formed. Each team member should be assigned
a given role prior to beginning the lab. These roles should
be as follows: meeting coordinator, time keeper, task
manager, and record/note keeper. In cases of teams of three,
the roles of meeting coordinator and time-keeper should be
combined. In cases of teams of five, two students may split
the role of record/note keeper.
How is positive interdependence ensured?
Each team will turn in one file
for each part of the lab—5 files total. Also, the assignment
of roles is set up to encourage positive interdependence.
How is individual accountability built in to the project?
The assignment of roles will also serve to help ensure
individual accountability, as each person has specific
responsibilities. Also, at the conclusion of the lab,
students will complete the
Individual Check for
Understanding.
Basis or Components of Assessment:
SAt the end of each part of the lab, a product is due. An
idea of how that product should look will have been given to
the students during the instructions for that activity.
Team Skills Needed for Success:
Team members must have the ability to communicate, cooperate
and collaborate; they must also feel free to contribute
their ideas and to give and receive constructive feedback.
How Are Team Skills Emphasized?
The organization of the lab—with
a product at the end of each meeting—will really emphasize
the needs for these skills
Materials
Needed by Students:
-
computers
- C
programming language tools
Content
Lesson Links:
Instruction to Students
Individual Check for Understanding
Lesson
| Instruction
to Students |
Individual Check for Understanding
©2001,
P.K.
Imbrie
These materials may be duplicated for educational purposes
if properly credited. |
|
|
|
|
Home |
Site Map |
Settings |
Contact Us |
© 2002, Arizona Board of Regents.
All Rights
Reserved. | |
|