Programming

posted by .

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 -

    And the question is?

    Sra

  • Programming -

    You better specify the programming language.

  • Programming -

    Programming language is C

  • Programming -

    What have you done so far, and what problems are you encountering?

Respond to this Question

First Name
School Subject
Your Answer

Similar Questions

  1. Unix Script

    "Using "if" statement checks for a file called "student.txt" in the current directory. Removes (deletes) the file if it exist. This file will collect last name, first name, and grade for 5 people. Use a while loop to get the information …
  2. Unix Shell script

    Shell script Using "if" statement checks for a file called "student.txt" in the current directory. Removes (deletes) the file if it exist. This file will collect last name, first name, and grade for 5 people. Use a while loop to get …
  3. programming

    Write a C program to sort the bags by weight. Assume that the input is given in a file. Each line of the input file corresponds to one polythene bag. For example a line in the file as below 10,20,20,10,10,50,10,50 corresponds to a …
  4. C++

    File version maintenance utility   A team of software developers has been asked to develop a file version maintenance utility . The utility should maintain all the  version of a file. When a user modifies a file, the current version …
  5. bookkeeping

    Using your computer, you create a file for an existing costumer. When you're finished, you should a. overwrite the existing file by giving the new file the same name. b. use Save as to save the new file under a different name c. coordinate …
  6. offfice finaces

    Using your computer software, you create a new file for an existing customer. When you're finished, you should A. coordinate the old and new files by giving both the same name. B. overwrite the existing file by giving the new file …
  7. Ed. Tech

    When you save documents, it is important to check the blank at the top of the navigation window to ensure you are saving your file in the correct location. A. address bar B. insert ribbon C. file type D. file name Is the answer D?
  8. Literature

    When you save documents, it is important to check the _____ at the top of the navigation window to ensure saving your file in the current location A.adress bar ** B.insert ribbon C.file type D.file name
  9. Computer science

    Need help on how write this program. "The Eversoft Eraser Company has a list of its customers’ names (not necessarily in alphabetical order) and telephone numbers in a file named "customer" with records of the following form: last_name …
  10. Microsoft word

    Suppose you want to delete an existing file from within Word. What would you do?

More Similar Questions