Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

please make sure that the main function resembles the main in 3rd ss. Thank you Change to your Assignment directory. Create a new subdirectory called

please make sure that the main function resembles the main in 3rd ss. Thank you image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
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 (20) - the number of rows in each layer (34)- the number of items (places) in each row The loop terminates when the user enters a zero as one or more of the inputs. (i.e. 203). 2) initializes the matrix (three dimensional array): create a function called InitMatrix) and place it in a file labeled Init Matrix.c using the code below for a random number generator fill the three dimensional array with random integers between 1 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: #ifndef HEADERS_H_INCLUDED #define HEADERS_H_INCLUDED Finclude #include #include #include "definitions.h" tendir // HEADERS_H__INCLUDED the other file is labeled definitions.h with the following contents: #ifndef DEFINITIONS_H_INCLUDED #define DEFINITIONS_H_INCLUDED void InitArray ( your parameter list here ); void printMatrix(your parameter list here ); Tendif // DEFINITIONS_H_INCLUDED Note: All of your c files will have the single include ONLY. #include "headers.h" Project One (1): Image Imaguilcompute-/private courses/622211/21/assignments/esm2/p_ Imagguitecompute projlis [Imaggui l compute projijs ./proji Enter values for Layers, Rows, Columns (elements in each row): 234 Original Matrix Layer 1 (1) 71 72 ( 2 ) 99 57 layers (3) 12 prompt Layer 2 (1) 50 77 (2) 38 se (3) 94 84 2 57 48 23 58 57 18 83 12 Be 99 42 96 number Enter values for Layers, Rows, Columns (elements in each row): e e [Imagguil@compute projijs [Imagguil@compute projijs FINISHED Code for generating random integers: int x, m - 100; time_t ti srand((unsigned) time (t)); x = (rand() $ m)+1; where: time_t is defined in the library of time.h mis 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.) The code for your main() function should resemble (in other words - does NOT have to be exactly as shown. Notice it does not contain any computational code. This describes what the program does and the sequence.) note: your code must include comments. tinclude "headers.h" // 092211b 2021 // Assignment Three (3) // Max Magguilla // 000326373 // Imagguil // March 03, 2021 int main() int a, b, printf(" Enter values for Layers. Rows, Columns (elements in each row): "); scanf("4d1d1d", ta, tb, te) whilo int InitArray printMatrix printf(" enter values for Layers, Rows, Columns (elements in each row"> scant ("4d 4d6d", fa, sb. 60) printf("FINISHED "); return 0; Note: All of your .c files will have the single include ONLY. #include "headers.h" Project One (1): Image Imagguil@compute-/private/courses/cs2211/W21/assignments/asn3/p. [Imagguil@compute projijs [Imagguil@compute proji]$ ./proji Enter values for Layers, Rows, Columns (elements in each row): 2 3 4 Original Matrix Layer 1 ( 1 ) 71 72 57 ( 2 ) 99 57 58 layers ( 3 ) 12 57 prompt Layer 2 ( 1 ) 50 99 ( 2 ) 30 42 ( 3 ) 94 96 49 48 18 23 77 90 84 83 12 80 row number Enter values for Layers, Rows, Columns (elements in each row): 0 0 0 FINISHED [Imagguil@compute proji] [Imagguil@compute projijs

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Visual Basic 4 Ole Database And Controls Superbible

Authors: Michael Hatmaker, C. Woody Butler, Ibrahim Malluf, Bill Potter

1st Edition

1571690077, 978-1571690074

More Books

Students also viewed these Databases questions

Question

=+ What are the information and consultation requirements?

Answered: 1 week ago

Question

=+ Should the MNE belong (why, why not)?

Answered: 1 week ago