al Matrix ayer 1 71 72 99 49 57 48 23 layers 57 18 58 57 12 pro ayer 2 50 77 90 30 66 42 83 12

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question
Project One (1): Image
2 Imagguil@compute-/private/courses/es2211/W21/assignments/asn3/p.
fimagguilecompute projijs ./proji
Enter values for Layers, Rows, Columns (elements in each row): 234
Original Matrix
Layer 1
(1) 71
72
57
48
49
(2 ) 99
layers
57
( 3 ) 12
58
57
18
23
prompt
Layer 2
(1) se
( 2) 30
(3) 94
77
83
12
99
90
42
84
80
96
row
number
Enter values for Layers, Rows, Columns (elements in each row): e e e
FINISHED
(Imagguilecompute projijs
(Imagguilecompute projijs
Code for generating random integers:
int x, m = 100;
time_t t;
srand ( (unsigned) time (st));
x = (rand () % m) +1;
where:
time_t is defined in the C library of time.h
m is range. In this case 100 signifies the range of 0 to 99, so we add I to the result.
(note: m will vary in the second project to match to the matrix size.)
Transcribed Image Text:Project One (1): Image 2 Imagguil@compute-/private/courses/es2211/W21/assignments/asn3/p. fimagguilecompute projijs ./proji Enter values for Layers, Rows, Columns (elements in each row): 234 Original Matrix Layer 1 (1) 71 72 57 48 49 (2 ) 99 layers 57 ( 3 ) 12 58 57 18 23 prompt Layer 2 (1) se ( 2) 30 (3) 94 77 83 12 99 90 42 84 80 96 row number Enter values for Layers, Rows, Columns (elements in each row): e e e FINISHED (Imagguilecompute projijs (Imagguilecompute projijs Code for generating random integers: int x, m = 100; time_t t; srand ( (unsigned) time (st)); x = (rand () % m) +1; where: time_t is defined in the C library of time.h m is range. In this case 100 signifies the range of 0 to 99, so we add I to the result. (note: m will vary in the second project to match to the matrix size.)
Change to your Assignment directory.
Create a new subdirectory called asn3 (all in lowercase) and change to that new directory.
Create a new subdirectory called projl (all in lowercase) and change to that new directory.
Create a program that:
1) prompts the user for three values. (You do not have to check for valid input type.)
The values are:
(1) - the number of layers in the matrix
(2) - the number of rows in each layer
(3") - the number of items (places) in cach row
The loop terminates when the user enters a zero as one or more of the inputs. (ie. 203).
2) initializes the matrix (three dimensional array):
create a function called InitMatrix() and place it in a file labeled InitMatrix.c
using the code below for a random number generator
fill the three dimensional array with random integers between I and 100 inclusive.
3) prints out the matrix (three dimensional array)
create a function called PrintMatrix() and place it in a file labeled PrintMatrix.e
label the Layer Number
label the Row Number
4) once the user elects to end the program., print out FINISHED.
5) create two (2) header files.
one file labeled headers.h with the following contents:
ifndet HEADERS_HINCLUDED
Fdefine HEADERS_INCLUDED
Finclude <stdio.h>
include cstdlib.h>
include ctime.h>
Finclude "definitions.h"
tendif // HEADERS HLINCLUDED
the other file is labeled definitions.h with the following contents:
Fifndef DEFINITIONS R_INCLUDED
Edefine DEFINITIONS H_INCLUDED
void Initarray your parameter list here ):
void printMatrixfyour parameter list here ):
tendit // DEFINITIONS_INCLUDED
Note: All of your.c files will have the single include ONLY.
include "headers.h"
Transcribed Image Text:Change to your Assignment directory. Create a new subdirectory called asn3 (all in lowercase) and change to that new directory. Create a new subdirectory called projl (all in lowercase) and change to that new directory. Create a program that: 1) prompts the user for three values. (You do not have to check for valid input type.) The values are: (1) - the number of layers in the matrix (2) - the number of rows in each layer (3") - the number of items (places) in cach row The loop terminates when the user enters a zero as one or more of the inputs. (ie. 203). 2) initializes the matrix (three dimensional array): create a function called InitMatrix() and place it in a file labeled InitMatrix.c using the code below for a random number generator fill the three dimensional array with random integers between I and 100 inclusive. 3) prints out the matrix (three dimensional array) create a function called PrintMatrix() and place it in a file labeled PrintMatrix.e label the Layer Number label the Row Number 4) once the user elects to end the program., print out FINISHED. 5) create two (2) header files. one file labeled headers.h with the following contents: ifndet HEADERS_HINCLUDED Fdefine HEADERS_INCLUDED Finclude <stdio.h> include cstdlib.h> include ctime.h> Finclude "definitions.h" tendif // HEADERS HLINCLUDED the other file is labeled definitions.h with the following contents: Fifndef DEFINITIONS R_INCLUDED Edefine DEFINITIONS H_INCLUDED void Initarray your parameter list here ): void printMatrixfyour parameter list here ): tendit // DEFINITIONS_INCLUDED Note: All of your.c files will have the single include ONLY. include "headers.h"
Expert Solution
steps

Step by step

Solved in 3 steps with 3 images

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY