Assignment Problem Description:In this Assignment, you will develop a file I/O based database system for storing and searching students information of IMAGINARY Academy.There are three files to store...

Assignment Problem Description:In this Assignment, you will develop a file I/O based database system for storing and searching students information of IMAGINARY Academy.There are three files to store information.students.txt:This file contains students' personal information such as unique id number (integer), First name (single word String), Last name (single word String), day of birth, the month of birth, and year of birth (all integers). See the example students.txt file for some sample data. But do not hard code your code to work only on these data. We can test your code with a different file of the same types of data. You can assume there should not be more than 2000 students.courses.txtThis file contains a list of courses offered by the AWESOME Academy. It contains course id (single word string), course name (single word string with a maximum of 50 characters), and total credit (float). See the example courses.txt file for some sample data. But do not hard code your code to work only on these data. We can test your code with a different file of the same types of data. You can assume there should not be more than 100 courses.enrollment.txtThis file contains the students' enrollment. It contains student id, course id, semester (single word string), and score (float). See the example enrollment.txt file for some sample data. But do not hard code your code to work only on these data. We can test your code with a different file of the same types of data. You can assume there should not be more than 5000 enrollments.You will develop a command-based system where a user will write a set of predefined commands and your code will perform the operation for those commands.Here is the list of commands and their description:search_students:This command asks the user for another option. The options are:

lname:This option asks for a student's last name and displays all the information of the students with the given last name. The information includes Student ID, Full Name, Date of birth., list of courses, semester, score, and letter grade. The grading scale is: A: >90 A, B: 80-89.99, C: 70 - 79.99, D: 60-69.99, F:


fname:This option asks for a student's first name and displays all the information of the students with the given first name. The information includes Student ID, Full Name, Date of birth., list of courses, semester, score, and letter grade


id:This option asks for a student's id number and displays all the information of the student with the given id number name. The information includes Student ID, Full Name, Date of birth., list of courses, semester, score, and letter grade


byear:This option asks for a student's year of birth and displays all the information of the student with the given year of birth. The information includes Student ID, Full Name, Date of birth., list of courses, semester, score, and letter grade
search_courses:This command asks the user for another option.
cid:This option asks for a course id and displays the course information and all the students enrolled to that course. The information should include: Course Name, credit, student name, semester, grade.

cid_semester:This option will ask the user for providing a courseid and semester and then it should display the list of students enrolled in that course on that particular semester.
add_course:This command will ask the user for a courseid, course name, and credit and add this record to the end of the course.txt file. Before adding the course, the system should check whether the course id already exists or not. If the course id already exists, it should display"violation of course id uniqueness. Cannot add the record."Note that, after adding the data to the file, you should reload the data to your program's structure. Otherwise, your code will not be able to find the data.count:This command has the following options:
students:this option will display the total number of students

students_course:this option will display the total number of students for each cid

students_semester:this option will display the total number of students for each semester
sort:This command will sort the student list based on their id number and display the list one student per line in the following format:sort: This command will sort the student list based on their id number and display the list one student per line in the following format:
id firstname lastname month/day/year of birth
exit:This command will exit the program. Otherwise, your program should keep waiting for more commands until the user chooses to exit.We can make the list longer and more complicated. But let us stop here.Sample output for the given input file (the italic texts are part of input):==================search_students lname amir------------------4 muhammad amir 5/12/1996c4 math2 spring19 95 Ac5 physics2 spring19 89 B------------------45 ali amir 10/10/1996------------------==================search_students fname amir------------------not found------------------==================search_students id 4------------------4 muhammad amir 5/12/1996c4 math2 spring19 95 Ac5 physics2 spring19 89 B------------------==================search_students byear 1996------------------4 muhammad amir 5/12/1996c4 math2 spring19 95 Ac5 physics2 spring19 89 B------------------1 christian thompsen 8/8/1996------------------45 ali amir 10/10/1996------------------==================search_course cid c1------------------intro_to_C 3edward travis fall19 80 Bcoral akagbosu fall19 70 Cahmed salah spring19 99 A------------------==================search_course cid_semester c1 fall19------------------intro_to_C 3edward travis fall19 80 Bcoral akagbosu fall19 70 C------------------==================add_course c1 java 3------------------"violation of course id uniqueness. Cannot add the record."------------------==================add_course c7 java 3------------------record added------------------==================count students------------------total students 8------------------==================count students_course------------------c1 3c2 4c3 1c4 2c5 2c6 0c7 0------------------==================count students_semester------------------fall19 8spring19 4------------------==================exit------------------Bye!Additional Restrictions and you have to follow this (Otherwise 50% penalty)!!!:0.Using dynamic memory allocation is optional. If you use dynamic memory allocation (DMA) for your structure arrays, you will get 10% extra credit.1. You are not allowed to use any global variable. However, you can define structure in the global space and also #define any constant if needed.2. You must have to write three load functions for the three files.The function prototypes should look like this:- void loadStudents(Students st[], int *numStudents): numStudents will receive a reference by the caller and will update the referenced variable according to the total number of students in the file.[you can remove the void and the array from this function signature if you use DMA. Otherwise, you are not allowed to change it]- int loadEnrollment(Enrollments en[]): This function loads the en[] array with the data from the enrollment file and returns the total number of enrollment entries.[you can change function signature if you use DMA. Otherwise, you are not allowed to change it]- int loadCourses(Courses course[]): This function loads the course[] array with the data from the course file and returns the total number of courses in the file.[you can change function signature if you use DMA. Otherwise, you are not allowed to change it]3. In the beginning of your code, you should load the data from each of the files into appropriate structures so that you don't have to access the file frequently to perform the operations.4. All the functions should be written after main function5. Write a function void menu(Students ArrayOfStudents[], int amountStudents, Courses ArrayOfCourses[], int amountCourses, Enrollments ArrayOfEnrollments[], int amountEnrolls): This function should be called from the main function after loading the array and all the commands should be handled in this function in addition to other functions.6. You can add more functions to simplify your code, to make it more readable, to make the testing easier. As a requirement, your code should implement at least 3 more functions.Very important Hints. It will make your coding easier:Always scratch ideas, do brainstorming before jumping to write your code. When you write a big code, write smaller pieces, and test it gradually. Do not wait to write your entire code for testing. A good idea would be to use many functions for different parts of your code so that it is easier to test different functionality by disabling and enabling different functions.There can be many different ways to solve this assignment. I am just providing some hints of one possibility:Use three structures and their arrays to store the data of three files.At the beginning of your program, read all the files, and load your arrays of structures with all the data. It would be a good idea to create three different functions to read the files so that you can call those functions whenever you need to read the file again and load your structure arrays. For example, for theadd_coursecommand, you will need to reload the file to your structure after adding the course.You can write an infinite loop for the menu. To perform an operation for any menu, you can create functions so that your main and the menu function will not be very big. Also, it will be easy to test your code by just commenting on one line in your menu function if you want to disable calling a particular menu.You will need to use strcmp a lot to compare the menu and also performing other operations.Keep reading and see the following very important hints to implement commands.How can you make conditional commands and where to put those scanf?For example, a command like this has three parts:search_students lname amirIn the above line, we have already provided 3 different inputs and you can have three scanf for them. Now, the question is which scanf will take each of them? It actually depends on which scanf is executed. Note that, if you have scanf inside an if statement, and if the condition in the if statement is true, then that scanf will be executed automatically and it will take the corresponding input from the above example command.Finally,do not hesitate to take our help for any confusion and even coding related help if you get stuck. Visit zoom office hours. I will create a discussion board and you can ask for general help there. It is not a difficult code at all. You already know everything. Just need to put the pieces together. That might take time and you might face issues. Debug, add some printf to see why you are getting a wrong result, take help from us, this is how programming works.Good luck!Caution! DO NOT HARD CODE:- Do not hard code any data from the file to your code and just to match the output without extracting data from the file and without producing the result from your variables.
- A single hardcode will result in 0 in your project.
Hard coding example (See it is not really sorting): void sort(){ printf("1 christian thompsen 8/8/1996\n2 coral akagbosu 9/9/1993\n4 muhammad amir 12/5/1996\n10 edward travis 31/12/1993\n13 ahmed salah 19/12/1993\n40 samer akileh 10/10/1994\n45 ali amir 10/10/1996\n"); }
See the above function does not really sort anything. It is hard coding the sorted result and it will never work on any other data set.Another hardcoding example: if (strcmp(semester, "fall 19").. See here, how did you get fall19 in this code? How about, if the file does not have fall 19? Should your code work?
Total points 100 [9% will be added to your course grade]. - In order to get full 100/100, the code has to pass all test cases, the code has to be well indented, should use functions and structures to make the code well organized.- If any one of the additional restriction points is not addressed, 50% penalty will be applied.Detailed rubric:- There are12 commands and subcommands (and scenarios)in the project.- - Implementing each command with the correct output format is 7 points.- Well structured and organized code and using functions as needed 16 points- If the code can run all the commands but cannot pass the test cases: -20 pointsShould you get 0 if your code does not compile?If a code does not compile, the student cannot get more than 50 points. In order to get this max 50 points we will see how you defined your structure, how you declared your arrays, have you implemented all the additional restrictions, were you able to read the files properly and loaded them in your arrays, how many commands would work if you did not have that error(s), etc. Due to time constraints, it is very difficult for us to pinpoint errors while grading. However, if your code has very basic types of errors and shows that you cannot write simple C code with proper variable declaration cannot write a loop, conditions, etc., then it will significantly reduce your grade.-If you use DMA, you will get 10% extra. However, don't forget to free memory after the exit command.Good luck! We are here to help if you get stuck!
Aug 06, 2021
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions ยป

Submit New Assignment

Copy and Paste Your Assignment Here