关键词 > ECE222 C代写

ECE222 Vectors And Matrices

发布时间:2025-12-25

Hello, dear friend, you can consult us at any time if you have any questions, add WeChat: daixieit

ECE222 Vectors And Matrices

Requirement

In this lab, each student is to write a program that allows the user to manipulate the entries in vector, or in a matrix. The program should keep track of one vector of variable length, and one matrix of exactly 4x4 size. The program should enter a loop, displaying a set of options (given below). Once the user selects an option, the program should display the vector (or matrix, as appropriate) before and after the operation chosen by the user. For example, if the user selects “reverse vector” and the current vector is [-3 0 2 5] then the program should display:

1   input

2   -3 0 2 5

3   reversed

4   5 2 0 -1

The program should run until the user selects an option to quit.

The program must use the following structure definitions.

1   struct vector {

2   float *data;

3   int size;

4   };

5   

6   struct matrix {

7   struct vector rows[4];

8   };