Use the following structure for problem 1. struct student{

Use the following structure for problem 1. struct student{ string name; int id; float mark; }; Declare an array named studentArray of the structure type shown above, the size of the array is limited to maximum 100. The main() function handles all interactions with the user and other functions:  It displays an appropriate welcoming message introducing the program.  Calls a function named readFile() which opens the text file grades.txt for reading and stores all of the students details from the file to an array named studentArray. The grades.txt has three columns, first column contains name, second column contains id and third column contains mark. The readFile()function has two parameters: one for receiving the file variable and one for the array, both receiving arguments passed by reference.  It then repeatedly calls the menu() function to display user options, get the user selection returned by the menu() function, use a switch statement to  process user request by calling appropriate function(s)  It displays the result with an appropriate message after processing user request.  It displays a goodbye message when the user selects the Quit option from the menu and terminates the program. The menu() function has no parameters. When called, it displays a menu of 8 options allowing the user to select one and returns this option to the calling main()function. The options displayed should be: (1) Display students’ details (2) Calculate average of all students’ marks (3) Sort the students’ details (4) Search for a particular student’s mark (5) Find maximum (6) Add new student to the record (7) Quit program  Option (1) will use a function called displayStudents()called from the main()to display the contents of the studentArray array on the screen in an appropriate format. The displayStudents() function has two parameters: the array and the size of the array.  Option (2) will use a function called calculateAverage() which is designed to calculate the average value of all marks in studentArray and return the result to the main() function which will then display it with an appropriate message. This function also has two parameters: the array and the size of the array.  Option (3): Ask if the user wants to sort the students’ details with respect to either name or marks. Call appropriate functions to do the same.  Option (4) is to search for a particular student’s mark. The function should have three parameters, array, size and the name (a string variable) that the user searching for. This function returns the index of the array if it is found otherwise it returns -1. Display all the details of that student in main function. User should have the options to use either linear search or binary search.  Option (5) will use a function called findMaximum()which is designed to find the largest value of all marks in studentArray and return the result to the main() function which will then display it with an appropriate message. This function has two parameters: the array and the size of the array.  Option (6) will first use a function called updateFile() which will open the file in append mode, prompt the user for new student’s name, id and mark, and then write the new data at the end of the file using the same format as the original file. It will then the call the readFile()function used in the beginning of the program again to read the contents of the updated file and repopulate the studentArray.  Option (7) will terminate the program after displaying an appropriate goodbye message.

How Our Website Works

1. FILL IN OUR SIMPLE ORDER FORM

It has never been easier to place your order. Fill in the initial requirements in the small order form located on the home page and press “continue” button to proceed to the main order form or press “order” button in the header menu. Starting from there let our system intuitively guide you through all steps of ordering process.

2. PROCEED WITH THE PAYMENT

All your payments are processed securely through PayPal. This enables us to guarantee a 100% security of your funds and process payments swiftly.

3. WRITER ASSIGNMENT

Next, we match up your order details with the most qualified freelance writer in your field.

4. WRITING PROCESS

Once we have found the most suitable writer for your assignment, they start working on a masterpiece just for you!

5. DELIVERY

Once finished, your final paper will be available for download through your personal dashboard. You will also receive an email notification with a copy of your paper attached to it. Sometimes, the writer may leave a note for you about the order in case there is any additional information that they need to give you.

Leave a Reply

Your email address will not be published.