Week13

# Week13 - ENEE 140 Introduction to Programming Concepts for...

This preview shows pages 1–2. Sign up to view the full content.

ENEE 140: Introduction to Programming Concepts for Engineers © Gang Qu Spring 2010 Week 13 No lab report due this week. Work on the project. Lab 23: Monday May 3 Lab 24: Wednesday May 5 Lab 25: Monday May 10 Some helpful problems/suggestions for the project. 1. data structure: what is the best way to store all the matrices? When you need to store the value of one integer, you can declare one variable of type int by int a; when you need to store the values of 100 integers, you can declare an array of type int and size 100 by int b[100]; when you need to store the entries of one integer matrix of size 5x5, you can use a 2-dimensional array int c[5][5]; when you need to 10 such matrices, you can do int d[10][5][5]; The 10 matrices defined this way can be accessed by d[0], d[1], …, d[9], just the same way you access one dimensional arrays. If you want to give each matrix a single character name such as A, B, C, P, Q, R, the easiest way that we can do now is to declare a character array char e[10]; and assign each element the name of those matrices such as e[0] = ‘A’; e[1] = ‘B’; . .. Use index as the key to connect a matrix and its name. For example, the name or matrix d[5] will be e[5] . 2. Use of functions: one of the key objectives of this project to learn how to implement and call functions. It will make your project much easier to implement and understand. Consider to declare and use at least the following functions:

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

### Page1 / 3

Week13 - ENEE 140 Introduction to Programming Concepts for...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document
Ask a homework question - tutors are online