-The program should print "COP 2220-50184 Project 3: <your name>" with a blank line before and after.
-Then it should prompt the user for the input file name of the file containing the data to sort.
- 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.
-The file will contain numbers that could be positive or negative integers or floating point numbers two numbers to a line.
-The program should only handle the first 90 numbers in the file.
-this program needs to be done in functions and not in main. I'm pretty bad at this and the only function Ive been able to accomplish is hello world. Any help would be much appreciated!! I basically dont know how to open the file and get the data into the program either.
#include <stdio.h>
// Function Declarations
void greeting();
int openFile(FILE* FP);
int main (void)
/* Local Declarations */
{
float nums[90];
FILE*FP;
greeting();
openFile(&FP);
/*Statements*/
return 0;
} /* end of Main */
/* Function Name: greeting
* Input Parameters: none
* Description: Function prints out class, project and name.
* Return Value: returns statement in parenthesis.
*/
void greeting ()
{
printf("\n\nCOP 2220-50184 Project 3: Daniel Greene\n\n") ;
return;
}
int openFile(FILE** FP)
{
*FP = fopen();
printf("\n\nEnter File Name\n\n") ;
scanf("%s, fName");
Fopen(fName, "r");
if(!fName)
{
printf("File name not valid.\n");
}