Due: June 8, 2023
Points: 100
Write a program to load the contents of the file into an array, and then print out the array.The program is to take 1 argument on the command line, which is the name of the file.
When you print it, print the weight as a floating point number and the symbol and name as strings. The three fields are separated by tabs. You can use this string as the format for printing: “%6.2f\t%s\t%s\n”.
If you encounter one of the following errors, here’s what you print:
Call your program “atomic.c”. You can find an executable for it, and the file atomic_weights.txt, in the directory /home/bishop/ecs36a/hw4.
So your program must take 1 (the file name) or 2 (the option and the file name) arguments.
Call your program “atomicsort.c”. You can find an executable for it, and the file atomic_weights.txt, in the directory /home/bishop/ecs36a/hw4.
Hint: You can write your own sort routine, or use the library function qsort(3).
Put the debugged program into a file called “getbit.c”.
|
ECS 36A, Programming & Problem Solving Version of May 30, 2023 at 11:15PM
|
You can also obtain a PDF version of this. |