#include #include #include #define LINES 10 #define MAX 50 #define SALESRM 0 #define STOCKRM 1 #define BATHRM 2 #define BREAKRM 3 #define OFFICE 4 struct date myday(struct date bday); struct date { int mo, day, yr; char moabbbr[LINES]; }; struct startupcosts { float buslicense; float utilitycon; float buspermit; float startupfund; int storenumber; char storename[MAX]; struct date openingday; }; typedef struct roomalldata { float len, wid; char rmname[MAX]; int rmtype; int rmnumber; int stockamts[6]; float area; // sq ft float rentalrate; } MYROOMS; // Function you may use in Lab #3 without the pointer penalty // You may also write a similar function for stock and staff data char *roomtypestring(int roomtype); int main() { struct roomalldata rooms[25], jcrooms; MYROOMS jcroom; char *my_string = NULL; char t; int fi; int arri[MAX]; float ff; rooms[0].rmtype = SALESRM; rooms[1].rmtype = BATHRM; rooms[2].rmtype = STOCKRM; rooms[3].rmtype = OFFICE; //using the roomtypestring function to get a string with the room type in it for (fi = 0; fi < 4; fi++) { my_string = roomtypestring(rooms[fi].rmtype); printf("\n In %s roomtype %d, there is %d amount of stock",my_string, rooms[fi].rmtype, 4-fi); } printf("\n"); //alternate way to use the roomtypestring function for (fi = 0; fi < 4; fi++) { printf("\n In %s number %d, stuff exists",roomtypestring(rooms[fi].rmtype), fi); } return 0; } // Function to print out a string with room type based on input integer roomtype char *roomtypestring(int roomtype) { switch(roomtype) { case SALESRM: return "Salesroom"; case STOCKRM: return "Stockroom"; case BATHRM: return "Bathroom"; case BREAKRM: return "Breakroom"; case OFFICE: return "Office"; } }