Question: This project should run exactly as shown in Project3. However, your code must use functions instead of putting everything inside the main function. Your program






This project should run exactly as shown in Project3. However, your code must use functions instead of putting everything inside the main function. Your program must implement the functions whose prototypes are given below. Feel free to add more functions whenever you see fit. void getId( int *pId This function asks the user to enter the student's id that is stored in *pId int checkNumberOfCourses int numCourses This function returns 0 if numCourses is not a valid number of courses (recall a student takes 0,1 or 2 courses). It returns 1 otherwise. int checkCourseNumber (int crn This function returns 0 if the passed crn isn't from the list of allowable crns. It returns1 otherwise. int getCreditHours ( int crn) This function uses a switch structure and returns the number of credit hours that go with the passed crn. For instance getcreditHours (4599 returns 3 void printInvoiceLine int crn, int creditHours) This function, when called, prints something like: 4599 $360.75 if crn is 4599 and creditHours is 3. This function should be called at most two times because a student takes up to two courses. void printInvoice int id, int crnl, int crn2 This function prints the fee invoice. Note that this function may call printInvoiceLine. Furthermore, make sure that your program doesn't have duplicate code; if you have duplicate code then you should use a function that you call twice or more to avoid duplication of code. This project should run exactly as shown in Project3. However, your code must use functions instead of putting everything inside the main function. Your program must implement the functions whose prototypes are given below. Feel free to add more functions whenever you see fit. void getId( int *pId This function asks the user to enter the student's id that is stored in *pId int checkNumberOfCourses int numCourses This function returns 0 if numCourses is not a valid number of courses (recall a student takes 0,1 or 2 courses). It returns 1 otherwise. int checkCourseNumber (int crn This function returns 0 if the passed crn isn't from the list of allowable crns. It returns1 otherwise. int getCreditHours ( int crn) This function uses a switch structure and returns the number of credit hours that go with the passed crn. For instance getcreditHours (4599 returns 3 void printInvoiceLine int crn, int creditHours) This function, when called, prints something like: 4599 $360.75 if crn is 4599 and creditHours is 3. This function should be called at most two times because a student takes up to two courses. void printInvoice int id, int crnl, int crn2 This function prints the fee invoice. Note that this function may call printInvoiceLine. Furthermore, make sure that your program doesn't have duplicate code; if you have duplicate code then you should use a function that you call twice or more to avoid duplication of code
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
