Preview

Lab01 Program Design Question

Good Essays
Open Document
Open Document
572 Words
Grammar
Grammar
Plagiarism
Plagiarism
Writing
Writing
Score
Score
Lab01 Program Design Question
Intended Learning Outcomes of this Exercise

Upon completion of this tutorial/lab, you should be able to:
Identify inputs, outputs, and processing components from a problem description.
Work out solution algorithm for the defined problem with sequence, selection and repetition control structures.
Write the solution algorithm with pseudocode.

Task 1: Tutorial Short Questions.
Task 2: Algorithms Development Problem 1. A simple problem with only sequence Problem 2. A problem with single selection Problem 3. A problem with multiple selections Problem 4. A problem with multiple selections Problem 5. A problem with repetition Problem 6. A challenging problem

References
1. Robertson, L.A. (2006). Simple Program Design (5th ed.). Boyd & Fraser Publishing Company, Chapters 1-3.

This exercise is designed for two 2-hour tutorial/lab sessions!

Task 1. Tutorial (30%)
Short Questions:
1. List the seven basic steps in computer program development.
2. What are the inputs and outputs of the following problems?
a. Calculating the area of a triangle
b. Calculating the solution(s) of a quadratic equation in form
c. Measuring the distance of two cities on Earth
d. A stop-watch
e. Generating a random number between 0.0000 to 1.0000
3. What are the two main advantages in using meaningful names for variables, e.g. intStudentAge, dblHeight, strAddress, etc.?
4. Determine the most suitable data types and give good names for the following variables.
a. A student’s English name
b. The examination mark of a student for the “Introduction to Programming” module
c. A student identification card number for an IVE student
d. The total number of items in a box
5. List the major steps in algorithm development.

Task 2. Algorithms Development (70%)
Problem 1. Units Conversion
A program is designed to convert a length in inches to centimeters (1 inch = 2.54 cm). Design an algorithm in pseudocode to solve the problem.
Problem 2. Direction of a Street in New York City
In New York



References: 1. Robertson, L.A. (2006). Simple Program Design (5th ed.). Boyd & Fraser Publishing Company, Chapters 1-3.

You May Also Find These Documents Helpful