Question: I need a c program for the following: ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- This is my code from lab 4 (EXERCISE 3) for Exercise 1: Challenge Questions / Exercises

I need a c program for the following:

I need a c program for the following: ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- This is my

----------------------------------------------------------------------------------------------------------------------------------------------------------------------------

This is my code from lab 4 (EXERCISE 3) for Exercise 1:

code from lab 4 (EXERCISE 3) for Exercise 1: Challenge Questions /

Challenge Questions / Exercises In this part of the Clab you will have to write three C programs based on what has been learned in the lectures and labs up to this point. In these questions in this lab and later labs, marks are given for code which compiles and runs (even if it doesn't meet the specification), good comments and layout, and also for code which performs the required tasks (for the more complex tasks in later labs, partially working code may get partial marks in this category). Exercise 1-Refactoring your own code In Lab 3, you wrote a simple program to print a PGM format image, and in Lab 4, you modified it to split out the code into multiple functions. Starting with your code from Lab 4, split out the function to print out the PGM file into a separate C source file (called printpgm.c). Create an appropriate header file to allow your function to be used in other code., with a suitable prototype. Modify the code in the original file to include the header file appropriately. Compile your two C files, and link appropriately, and test that the code still does what it is supposed to do. Write an appropriate makefile so that anyone can compile the full code, and add appropriate compiler flags to enable debugging (-g) and the 199 standard (-std=c99). The makefile from Exercise 3 may help with this as a starting point. You should have appropriate comments in all of the files, including the makefile, and present your code in a consistent and readable manner. Three C source code files (2.c, 1.h), and one makefile, are your submission for this exercise. i 2 #include 3 #include 4 5 int fill(unsigned short int image[15][15], int width, int height, int max) // Defines function that fills image 6 7-{ 8 int i = 1; 9 for(i; i

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!