Posted by Don on Wednesday, June 29, 2011 at 5:55pm.
2. Then it should prompt the user for the input file name of the file containing the data to sort.
3. If the program can't open the file or if no file name is entered (^d or ^z is entered for EOF), it should print an error message and exit.
4. The file will contain numbers that could be positive or negative integers or floating point numbers two numbers to a line.
5. The program should only handle the first 90 numbers in the file.
6. The program should read the numbers from the file into an array and then sort in ascending order (low to high) them.
7. If the program encounters a non-numeric value in the file, it should print an error message indicating the line number of the line containing the error and discard that input line in the file and go to the next line.
8. The program should print the sorted list of numbers, four numbers to a line in columns fifteen characters wide with four digits to the right of the decimal point.
9. After printing the sorted list, it should print:
o There were <number> numbers found in file <file name>.
o The largest number found was: <number>
o The smallest number found was: <number>
o The average of the values is: <number>
10. If there are no numbers in the file, the program should only print the following line
o There were 0 numbers found in file <file name>.
11. Include comments in your code (see project two for the required comment block formats) to explain what the code does.
12. See the examples below for spacing and formatting.
13. Your program should be well structured. The work should be done in functions, not in main. Include at least four functions that you will define.
14. The program can not use global variables except for a debug variable.
- Programming - SraJMcGin, Wednesday, June 29, 2011 at 6:04pm
And the question is?
- Programming - Damon, Wednesday, June 29, 2011 at 6:14pm
You better specify the programming language.
- Programming - Don, Wednesday, June 29, 2011 at 7:46pm
Programming language is C
- Programming - MathMate, Wednesday, June 29, 2011 at 10:10pm
What have you done so far, and what problems are you encountering?
Answer this Question
More Related Questions
- programming - Write a C program to sort the bags by weight. Assume that the ...
- Unix Script - "Using "if" statement checks for a file called "student.txt" in ...
- C++ - File version maintenance utility A team of software developers has been...
- Unix Shell script - Shell script Using "if" statement checks for a file called...
- bookkeeping - Using your computer, you create a file for an existing costumer. ...
- offfice finaces - Using your computer software, you create a new file for an ...
- Literature - When you save documents, it is important to check the _____ at the ...
- Computer science - Need help on how write this program. "The Eversoft Eraser ...
- Ed. Tech - When you save documents, it is important to check the blank at the ...
- Programming and algorithms - For each of the following problems, use the top-...