Answer & Explanation:Hi,Please write a program by using C language and use codeblocks to write the program. Also, please while writing the program add comments on every step you take, explaining the steps and functions that you used ,for example( printf is used to print the following statement…) and so on .Thank you 😀
Unformatted Attachment Preview
“The bubble sort algorithm”
You are expected to demonstrate a working C program according to the description below. Your program
should be uploaded (via Brightspace) before the deadline. You must use the file name specified in the problem
description below. Late submissions will not be corrected and will receive zero credit, so even if your program
is not running correctly, you should submit your “best attempt”.
A common application in programming is that of reading data records from a text file and sorting the records
into alphabetical order. In this programming assignment, you are asked to read in student names and marks from
a short data file, and to provide an output with the names in alphabetical order. You may assume a maximum
number of 100 students. The files raw1.txt and raw2.txt are provided as examples of files containing
records to be sorted. You should output the sorted records to a file called sorted.txt. For example, the file
raw1.txt is as follows:
In this case, the output file sorted.txt should look like:
The name of the input file should be provided to your program by the user, as follows (user input in bold):
Enter name of file containing student records to be sorted: raw1.txt
The Bubble Sort Algorithm
In the bubble sort algorithm, a pass through a data set consists of comparing adjacent pairs of elements and
effecting a swap if two elements are out of order (as shown in Table 1). Each such pass will ensure that at least
one element will be in its correct position. The process is repeated until the list is fully sorted.
Table 1: Bubble sort algorithm
Initial state of
0 and 1
comparing slots 1
2 and 3
C source code as described above
YOUR PROGRAM WILL NOT BE GRADED UNLESS IT HAS THE CORRECT FILENAME
STUDENTS MUST WORK INDEPENDENTLY. PROGRAMS WILL BE EXAMINED FOR
EVIDENCE OF COPYING. COPYING OR ALLOWING YOUR WORK TO BE COPIED WILL
RESULT IN A GRADE OF “NM” BEING ALLOCATED FOR THE ASSIGNMENT.
Cahill, Catherine 78
Byrne, Geraldine 45
Purchase answer to see full
Delivering a high-quality product at a reasonable price is not enough anymore.
That’s why we have developed 5 beneficial guarantees that will make your experience with our service enjoyable, easy, and safe.
You have to be 100% sure of the quality of your product to give a money-back guarantee. This describes us perfectly. Make sure that this guarantee is totally transparent.Read more
Each paper is composed from scratch, according to your instructions. It is then checked by our plagiarism-detection software. There is no gap where plagiarism could squeeze in.Read more
Thanks to our free revisions, there is no way for you to be unsatisfied. We will work on your paper until you are completely happy with the result.Read more
Your email is safe, as we store it according to international data protection rules. Your bank details are secure, as we use only reliable payment systems.Read more
By sending us your money, you buy the service we provide. Check out our terms and conditions if you prefer business talks to be laid out in official language.Read more