Answered step by step
Verified Expert Solution
Question
1 Approved Answer
I am not sure how to make this work, I included the sections of instructions and the provided code that is supposed to be fixed,
I am not sure how to make this work, I included the sections of instructions and the provided code that is supposed to be fixed, some help would be awesome I got the first part done but then got to this and am really confused, I am new to C programming.
In this assignment, we will be making a program that reads in student's information, and create a classroom seating arrangement with a number of rows and columns specified by a user. Then it will attempt to assign each student to a seat in an classroom Use the file homework part 2.c (attached at the end of this document). Complete the file and include all the following requested code in the file homework part 2.c Step 1 First, you need to create a structure student. It should contain two variables, last name (char [30]) and first _name (char [30]). In addition, the following functions should be defined Function void student init default (struct student *s) Description Assign the default string" ??? " to both variables last name and first name void student init (struct student *s, char *info) Use the strtok function to extract first name and last name from the variable student, then assign them to each instance variable of the student structure. An example of the input string is David/Johnson void student to string (struct student *s) It prints the initial character of the first name, a period, the initial character of the last name, and a period. An example of such string for the student David Johnson is D.J Step 2. You will be creating a structure called classroom seating in the same code file. The structure classroom seating will contain a 2-dimensional array called "seating" of student type Define the following functions Function Description It instantiates a two-dimensional array of the size "rowNum" by "columnNum" specified by the parameters inside the struct a. Then it initializes each student element of this array using the student init default function, So, each student will have default values for its instance variables void classroom seating init (int rowNum, int columnNum, struct classroom seating *a) In this assignment, we will be making a program that reads in student's information, and create a classroom seating arrangement with a number of rows and columns specified by a user. Then it will attempt to assign each student to a seat in an classroom Use the file homework part 2.c (attached at the end of this document). Complete the file and include all the following requested code in the file homework part 2.c Step 1 First, you need to create a structure student. It should contain two variables, last name (char [30]) and first _name (char [30]). In addition, the following functions should be defined Function void student init default (struct student *s) Description Assign the default string" ??? " to both variables last name and first name void student init (struct student *s, char *info) Use the strtok function to extract first name and last name from the variable student, then assign them to each instance variable of the student structure. An example of the input string is David/Johnson void student to string (struct student *s) It prints the initial character of the first name, a period, the initial character of the last name, and a period. An example of such string for the student David Johnson is D.J Step 2. You will be creating a structure called classroom seating in the same code file. The structure classroom seating will contain a 2-dimensional array called "seating" of student type Define the following functions Function Description It instantiates a two-dimensional array of the size "rowNum" by "columnNum" specified by the parameters inside the struct a. Then it initializes each student element of this array using the student init default function, So, each student will have default values for its instance variables void classroom seating init (int rowNum, int columnNum, struct classroom seating *a)Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started