travillian-lab-1.txt

Lab 1: Programming Background

In this lab, you will answer a few questions to see what kind of programming background you have that may be appropriate for the class. This will also be a second opportunity to work with submitting files in Moodle.

Create an ASCII (plain) text file (.txt file extension) which will contain your answers to the questions asked below. The first two lines of the text file shall contain this your name (first and last) and lab name and number (Lab 1: Programming Background). Please number you answers in the text file.

Questions

Provide short answers to the following questions.

1. Define the programming term reserved word or keyword.

2. What makes a variable a local variable?

3. When would a programmer use the while statement?

4. What is meant by the phrase calling a function?

5. What is the effect of an assignment statement?

6. Programming languages use various data types. Name any two (2) data types.

7. The pseudo-code below describes a process. Summarize in English the overall result of the process for any given value of x. (That is, what is the common name for this operation.)
1) get a number x
2) if x < 0, change x to –x
3) display x
4) end

8. The flowchart below describes a process. After the process is finished, what is the value of x that is displayed?

9. A function exists f(x) = 3x – 1. If x = 2, what is the value of f(f(x))?

10. Write a program in any computer language that will display the numbers: 1, 2, 3, 4, 5, 6, 7, 8, 9, 10. The program must use a loop. State the language you use.

Notes

Please remember to number your answers in the text file that you will submit. There is no need to repeat the question.

The first two lines of the file shall include your name and this homework designation: Lab 1: Programming Background

A blank line shall separate the answers from each other and from the header information.

When you have answered these questions, upload the plain text file with your answers to the Lab 1 page in Moodle.

Submission

One file, the text file, as described above.

Grading Rubric

Check - Answers are reasonable. The file formatting specified in the write-up is followed.

Minus - A major problem with one or more of the answers or the file formatting does not follow the specification.

Zero - Both a major problem with one or more of the answers and the file formatting does not follow the specification. Also, the lab is not submitted by the deadline.