Question: #include #define GARDEN _ ROWS 5 #define GARDEN _ COLS 5 #define TRUE 1 #define FALSE 0 / * Provided enum flowers DO NOT MODIFY
#include
#define GARDENROWS
#define GARDENCOLS
#define TRUE
#define FALSE
Provided enum flowers
DO NOT MODIFY THIS ENUM
enum flowers
EMPTY,
DAISY,
ROSE,
TULIP
;
Provided struct garden
DO NOT MODIFY THIS STRUCT
struct garden
enum flowers flower;
int bloomcountdown;
int isgardener;
;
provided function prototypes
DO NOT MODIFY THESE FUNCTION PROTOTYPES
void printgardenstruct garden gardenGARDENROWSGARDENCOLS;
int growgardenstruct garden gardenGARDENROWSGARDENCOLS;
int mainvoid
printfWelcome to the planter!
;
TODO SECOND: IMPLEMENT THE MAIN FUNCTION
Provided printf statements to help you get started
printf
Nothing
Daisy
Rose
Tulip
"Which Flower would you like to plant in this row?
;
return ;
Decreases the bloomcountdown for all flowers in the garden
Parameters:
garden: a D array of struct garden
Returns:
int: returns if a flower has grown, otherwise
int growgardenstruct garden gardenGARDENROWSGARDENCOLS
TODO FIRST: decrease bloomcountdown for all flowers in the garden
return FALSE;
DO NOT MODIFY ANYTHING BELOW THIS LINE
Prints the garden to the terminal
Parameters:
garden: a D array of struct garden
Returns:
void
void printgardenstruct garden gardenGARDENROWSGARDENCOLS
printf
;
for int i ; i GARDENROWS; i
for int j ; j GARDENCOLS; j
if gardenijisgardener
printf# ;
else if gardenijflower EMPTY
printf;
else if gardenijbloomcountdown
printfd gardenijbloomcountdown;
else if gardenijflower DAISY
printfD ;
else if gardenijflower ROSE
printfR ;
else if gardenijflower TULIP
printfT ;
else
printf;
printf
;
printf
;
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
