•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the C section within the Software Development category of DaniWeb, a massive community of 392,071 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 4,238 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our C advertiser:
Views: 1695 | Replies: 16
![]() |
•
•
Join Date: Jul 2006
Posts: 17
Reputation:
Rep Power: 3
Solved Threads: 0
This is the program. Re-using the tuition calculations from Lab1, and write a program to do the following:
Read student classifications and numbers of units from the data file LAB2IN.TXT. (No error
checking of data read from input file is required.) Then write each student's resulting tuition to a
second data output file, LAB2OUT.TXT.
As each tuition is computed, save it in one of two arrays for further processing at the end of the
program. The first array will hold the tuition paid by undergraduate students, and the second will
hold the tuition paid by graduate students. There will be no more than 100 students of either
type, and there may be only one type in the file.
After ALL of the tuitions have been computed, use the data in the arrays to calculate the low, high,
and average tuition paid by undergraduate students and the low, high, and average taxes paid by
graduate students (Do NOT compute the sums or any other part of the low, high, and averages until
AFTER all tuitions have been computed and placed in the arrays). Display the results to the
screen, along with a count of the type of student, as follows (same format for graduate students):
For 21 undergraduate students:
Lowest tuition paid = $ 750.00
Highest tuition paid = $ 5100.00
Average tuition paid = $ 4566.12
Break the program into functions. Include at least the following functions:
Read one student’s classification
Compute one tuition Compute the low/high/average tuition paid
Write one result to the file Display the low/high/average tuition paid
Input: File LAB2IN.TXT format is one line per tuition paying student, as follows:
Classification: character (uppercase U or G)
Units: positive integer
Sample Lines: U 20
G 9
NOTE: You will have to create your own sample data file to test this program, but
you instructor will use one of his/her own creation
The first issues is with the funcation. Not to sure how i would set them up. I'm use to pascal where i can write a funcation and it does that and its call from the main program. But Im a little lost on this one. becasue what I have written dose not look right.
Read student classifications and numbers of units from the data file LAB2IN.TXT. (No error
checking of data read from input file is required.) Then write each student's resulting tuition to a
second data output file, LAB2OUT.TXT.
As each tuition is computed, save it in one of two arrays for further processing at the end of the
program. The first array will hold the tuition paid by undergraduate students, and the second will
hold the tuition paid by graduate students. There will be no more than 100 students of either
type, and there may be only one type in the file.
After ALL of the tuitions have been computed, use the data in the arrays to calculate the low, high,
and average tuition paid by undergraduate students and the low, high, and average taxes paid by
graduate students (Do NOT compute the sums or any other part of the low, high, and averages until
AFTER all tuitions have been computed and placed in the arrays). Display the results to the
screen, along with a count of the type of student, as follows (same format for graduate students):
For 21 undergraduate students:
Lowest tuition paid = $ 750.00
Highest tuition paid = $ 5100.00
Average tuition paid = $ 4566.12
Break the program into functions. Include at least the following functions:
Read one student’s classification
Compute one tuition Compute the low/high/average tuition paid
Write one result to the file Display the low/high/average tuition paid
Input: File LAB2IN.TXT format is one line per tuition paying student, as follows:
Classification: character (uppercase U or G)
Units: positive integer
Sample Lines: U 20
G 9
NOTE: You will have to create your own sample data file to test this program, but
you instructor will use one of his/her own creation
The first issues is with the funcation. Not to sure how i would set them up. I'm use to pascal where i can write a funcation and it does that and its call from the main program. But Im a little lost on this one. becasue what I have written dose not look right.
/*****************************************
File Name: Tmitchellwk2
Description: Calcutaing tuition based on Classification and number of
credits
Date: 7/18/06
Desinger: Tabatha Mithcell
Functions: Input, output
*****************************************/#include <stdio.h>
main ()
{
#define flatfeeone 500.00 /*flat rate for up to 6 credits*/
#define Flatfeeu 450.00 /*rate for undergrad rate for 6 to 12
credits*/
#define Flatfeeg 750.00 /*rate for graduate for 6 to 12 credits*/
#define flatunit 250.00 /*rate for fee per credit up to 6 credits*/
#define Flatunitu 245.00 /*rate for undergrate for 6-12 credits*/
#define Flatunitg 285.00 /*rate for graduate for 6-12 credits*/
#define Flatpuu 270.00 /*rate for undgrade for 12-18 credits*/
#define Flatgu 340.00 /*rate for graduate for 12-18 credit*/
#define Flatu 5100.00 /*rate for undgrade for 18 or more credits*/
#define Flatg 6400.00 /*rate for graduate for 18 or more credits*/
int credits; /*number of credits the person is taking*/int datain; /*funstion to get data from file.
char status; /*Student status (G,g-Grad or U,u-Undergrad)*/
FILE *indate, *outdata; //Input file
Function Datain;
indata = fopen ("C.\\LAB2IN.txt", "r");
if (fopen == Null)
printf ("Error openeing file\n);
else
print ("Status and Grades read from file:\n");
while (fscan (fin, "%c", &status) != EOF){//READ ONE STATUS
print ("t%c\n", status);
if ( (status == 'g') || (status == 'G') ) //stating the calculations for grad
{
if ( (credits > 0) && (credits <= 6) )
cost = flatfeeone + (credits * flatunit);
if ((credits > 6) && (credits <= 12))
cost = Flatfeeg + (credits *Flatunitg);
if ((credits > 12) && (credits <=18))
cost = Flatgu * credits;
if (credits > 18)
cost = Flatg;
}
else if ((status == 'u') || (status == 'U')) //starting the calculations for undergrad
{
if ( (credits > 0) && (credits <= 6))
cost = flatfeeone + (credits * flatunit);
if ( (credits > 6) && (credits <= 12))
cost = Flatfeeu + (credits *Flatunitu);
if ( (credits > 12 ) && (credits <= 18))
cost = Flatpuu * credits;
if (credits > 18)
cost = Flatu;
}
datain;
getchar();
getchar();
return 0;
}
Last edited by mitchelltab : Jul 20th, 2006 at 1:50 pm.
•
•
Join Date: Jul 2005
Posts: 1,095
Reputation:
Rep Power: 9
Solved Threads: 141
Start with restatement of instructions, like this:
Now go back and try to expand on each of those lines as needed until you get to code to compile---only write one function at a time! I don't use C so the code in here is best guess only. Even if in error, the code should give you an idea of how to do proceed.
Once you can create a testData file, open it, and read in a students values, one student at a time, then go on to the next function. BEWARE of bugs in this "program" so far. I haven't compiled/ran it. This is just to give you an idea of how to proceed.
//I need to use these header files to do what I want //the following values are defined as constants //At minimum I need to use these functions: Read one student’s classification Compute one tuition Compute the low/high/average tuition paid Write one result to the file Display the low/high/average tuition paid //The process would be: //declare variables to use array of undergraduate students array of graduate students a given student something to read to/from a file open file test if file opened successfully while there is information to be read in th input file read in a single students information compute this students tuition store tuition in appropriate array write tuition to file Compute the low/high/average tuition paid Display the low/high/average tuition paid
Now go back and try to expand on each of those lines as needed until you get to code to compile---only write one function at a time! I don't use C so the code in here is best guess only. Even if in error, the code should give you an idea of how to do proceed.
//I need to use these header files to do what I want
#include <cstdio> //standard input and output for C language
//the following values are defined as constants
//a list of defines from your snippet could go here
//At minimum I need to use these functions: // these will be function prototypes
//Read one student’s classification
int readStudentDataFromFile(FILE *, char &, int &);
//Compute one stgudents tuition
//Compute the low/high/average tuition paid
//Write one result to the file
//Display the low/high/average tuition paid
//The process would be:
int main()
{
//declare variables to use:
const int MAX = 100; //maximum number of tuitions per array
int numberRead; //number of variables read in by fscanf
//array of undergraduate student tuitions
int undergraduateTuitions[MAX];
//array of graduate students
int graduateTuitions[MAX];
//a given student
char status; //will be either U or G
int credits; //will be greater than zero
//something to read to/from a file
FILE * filePtr;
char * inputFIleName = "testData.txt";
//open file
fopen(filePtr, inputFileName, "r"); //or whatever, I usually use C++ so this is just a guess
//test if file opened successfully
//should have learned how to do this in class
//read in a single students information
numberRead = readStudentDataFromFile(filePtr, status, credits)
//while there is information to be read in the input file
while(numberRead == 2)
{
//confirm data read in from file
printf("status of this student is %c \n", status);
printf("number of credits for this student are %d, credits);
//pause program to read data read in from file
getch();
//compute this students tuition
//store tuition in appropriate array
//write tuition to file
//read in a single students information
numberRead = readStudentDataFromFile(filePtr, status, credits)
}
//Compute the low/high/average tuition paid for undergraduates
//Display the low/high/average tuition paid
//Compute the low/high/average tuition paid for graduates
//Display the low/high/average tuition paid
return 0;
}
//function definitions here:
int readStudentDataFromFile(FILE * filePtr, char & status, int & credits)
{
int numb= fscanf(filePtr, "%c %d", &status, &credits);
return numb;
}
//create a text file called testData.txt containing something like this to start
U 9
G 17Once you can create a testData file, open it, and read in a students values, one student at a time, then go on to the next function. BEWARE of bugs in this "program" so far. I haven't compiled/ran it. This is just to give you an idea of how to proceed.
•
•
Join Date: Jul 2005
Posts: 1,095
Reputation:
Rep Power: 9
Solved Threads: 141
The function prototype tells the compiler that there will be a function of a given name using a given number and type of parameters that will be presented in a given order and that the function will return a given type. The definition, which can be placed before main() is declared, if you wish, instead of the prototype, will include all of that information and will include names of all of the parameters as well as the function body.
The function will do whatever it is told to do in the body of definition to the parameters it is passed and return whatever it is told to.
In my example:
int readStudentDataFromFile(FILE *, char &, int &);
is the prototype. With this information the compiler knows that the function readStudentDataFromFile() will take three parameters. The first parameter will be a pointer to a struct of type FILE, the second parameter will be a reference to a char, and the third will be a reference to an int. In addition the function will return an int. At this point, there is no way to know exactly what the function will do. That information is what is in the function body.
The following is the definition of the readStudentDataFromFile() function.
int readStudentDataFromFile(FILE * filePtr, char & status, int & credits)
{
int numb= fscanf(filePtr, "%c %d", &status, &credits);
return numb;
}
Now each of the parameters is given a name. Within the opening { and the closing } are instructions as to what the function will do with the parameters. In this case all three of the parameters passed to readStudentDataFromFile() are passed to the fscanf() function. In turn, fscanf() will read the contents of the file that was previously opened and asssociated with filePtr. fscanf() will put the first token it finds in the file into the address of the parameter called status and it will put the second token in the file into the address of the parameter called credits. fscanf() will return the number of variables it read in which is then stored in numb. numb is then returned from readStudentDataFromFile() back to where ever it was called from. The return value can be used for whatever purpose you want, including ignoring it, but I used it as a check to help ensure proper reading of the file.
In main() I told the program to call readStudentDataFromFile() when I wrote this:
numberRead = readStudentDataFromFile(filePtr, status, credits);
This says to pass the variables filePtr, status, and credits to readStudentDataFromFile() and that the return value of readStudentDataFromFile(), that is numb, will be assigned to numberRead.
The while loop in main says if numberRead doesn't equal 2 then fscanf didn't read stuff from the file correctly so readStudentDataFromFile() should stop being called. Hopefully, that doesn't happen until the end of the file. If numberRead wasn't 2 you could check it's value. If numberRead equals EOF, then you are at the end of the file and alls well. If numberRead is anything but 2 or EOF, then the file is probably corrupt. I didn't do those steps, however. In my code, I just left it that if numberRead is 2 I will confirm what data was read in with the printf() statements and pause the program long enough so I can read them and check them against the data in my test file.
If everything checks out to this point then I know I can: open and associate the correct file with my program and I can read data from the file in the way I want. Now I can go on to deal with that information according to the instructions given by the instructor.
Note that all three parameters passed to readStudentDataFromFile() were passed by reference. This means that whatever is done to them in readStudentDataFromFile() will be visible back in main(). So in this example where the file read had the first student data of U 9, the value of status back in main() will be U and the value of credits back in main() will be 9, even though the value of those variables was determined in readStudentDataFromFile() which in turn really got the data from fscanf(), again, by passing the parameters to fscanf() by reference, rather than by value. I don't think any of the other functions you will need to write for this program will embed a function within a function like readStudentDataFromFile() did, but it is a very common practice.
The function will do whatever it is told to do in the body of definition to the parameters it is passed and return whatever it is told to.
In my example:
int readStudentDataFromFile(FILE *, char &, int &);
is the prototype. With this information the compiler knows that the function readStudentDataFromFile() will take three parameters. The first parameter will be a pointer to a struct of type FILE, the second parameter will be a reference to a char, and the third will be a reference to an int. In addition the function will return an int. At this point, there is no way to know exactly what the function will do. That information is what is in the function body.
The following is the definition of the readStudentDataFromFile() function.
int readStudentDataFromFile(FILE * filePtr, char & status, int & credits)
{
int numb= fscanf(filePtr, "%c %d", &status, &credits);
return numb;
}
Now each of the parameters is given a name. Within the opening { and the closing } are instructions as to what the function will do with the parameters. In this case all three of the parameters passed to readStudentDataFromFile() are passed to the fscanf() function. In turn, fscanf() will read the contents of the file that was previously opened and asssociated with filePtr. fscanf() will put the first token it finds in the file into the address of the parameter called status and it will put the second token in the file into the address of the parameter called credits. fscanf() will return the number of variables it read in which is then stored in numb. numb is then returned from readStudentDataFromFile() back to where ever it was called from. The return value can be used for whatever purpose you want, including ignoring it, but I used it as a check to help ensure proper reading of the file.
In main() I told the program to call readStudentDataFromFile() when I wrote this:
numberRead = readStudentDataFromFile(filePtr, status, credits);
This says to pass the variables filePtr, status, and credits to readStudentDataFromFile() and that the return value of readStudentDataFromFile(), that is numb, will be assigned to numberRead.
The while loop in main says if numberRead doesn't equal 2 then fscanf didn't read stuff from the file correctly so readStudentDataFromFile() should stop being called. Hopefully, that doesn't happen until the end of the file. If numberRead wasn't 2 you could check it's value. If numberRead equals EOF, then you are at the end of the file and alls well. If numberRead is anything but 2 or EOF, then the file is probably corrupt. I didn't do those steps, however. In my code, I just left it that if numberRead is 2 I will confirm what data was read in with the printf() statements and pause the program long enough so I can read them and check them against the data in my test file.
If everything checks out to this point then I know I can: open and associate the correct file with my program and I can read data from the file in the way I want. Now I can go on to deal with that information according to the instructions given by the instructor.
Note that all three parameters passed to readStudentDataFromFile() were passed by reference. This means that whatever is done to them in readStudentDataFromFile() will be visible back in main(). So in this example where the file read had the first student data of U 9, the value of status back in main() will be U and the value of credits back in main() will be 9, even though the value of those variables was determined in readStudentDataFromFile() which in turn really got the data from fscanf(), again, by passing the parameters to fscanf() by reference, rather than by value. I don't think any of the other functions you will need to write for this program will embed a function within a function like readStudentDataFromFile() did, but it is a very common practice.
Last edited by Lerner : Jul 20th, 2006 at 5:52 pm.
•
•
Join Date: Jul 2006
Posts: 17
Reputation:
Rep Power: 3
Solved Threads: 0
This is where I have gotten so far. But I'm having issues reading more then one line of data. And and lost on how to put these items into tow arrays any help. please. I could get it to read from the file and out it on the display but not save to the file.
/*****************************************
File Name: Tmitchellwk2
Description: Calcutaing tuition based on Classification and number of
credits
Date: 7/18/06
Desinger: Tabatha Mithcell
Functions: Input, output
*****************************************/#include <stdio.h>
main ()
{
#define flatfeeone 500.00 /*flat rate for up to 6 credits*/
#define Flatfeeu 450.00 /*rate for undergrad rate for 6 to 12
credits*/
#define Flatfeeg 750.00 /*rate for graduate for 6 to 12 credits*/
#define flatunit 250.00 /*rate for fee per credit up to 6 credits*/
#define Flatunitu 245.00 /*rate for undergrate for 6-12 credits*/
#define Flatunitg 285.00 /*rate for graduate for 6-12 credits*/
#define Flatpuu 270.00 /*rate for undgrade for 12-18 credits*/
#define Flatgu 340.00 /*rate for graduate for 12-18 credit*/
#define Flatu 5100.00 /*rate for undgrade for 18 or more credits*/
#define Flatg 6400.00 /*rate for graduate for 18 or more credits*/
int credits; /*number of credits the person is taking*/
char status; /*Student status (G,g-Grad or U,u-Undergrad)*/
float cost; /*amount of tutition*/
FILE *indata, *outdata; //Input file and output files
indata = fopen ("e:\\LAB2IN.txt", "r");
outdata = fopen ("e:\\LAB2OUT.txt", "w");
if (indata == NULL && outdata == NULL){
printf ("Error opening one of the files \n\n");}
while (fscanf (indata, "%c" ,&status, "%d", &credits) == EOF)
{//READ ONE STATUS
if(status == 'G') //stating the calculations for grad
{
if ( (credits > 0) && (credits <= 6) )
cost = flatfeeone + (credits * flatunit);
if ((credits > 6) && (credits <= 12))
cost = Flatfeeg + (credits *Flatunitg);
if ((credits > 12) && (credits <=18))
cost = Flatgu * credits;
if (credits > 18)
cost = Flatg;
}
else if (status == 'U') //starting the calculations for undergrad
{
if ( (credits > 0) && (credits <= 6))
cost = flatfeeone + (credits * flatunit);
if ( (credits > 6) && (credits <= 12))
cost = Flatfeeu + (credits *Flatunitu);
if ( (credits > 12 ) && (credits <= 18))
cost = Flatpuu * credits;
if (credits > 18)
cost = Flatu;
}
fprintf (outdata, "\nClass %c", status);
fprintf (outdata, "\nUnits %d", credits);
fprintf (outdata, "\nTuition $%.2f\n", cost);
fclose (indata); //close the indata file
fclose (outdata); //close the indata file
printf ("Output file is compelete.");
}
getchar();
getchar();
return 0;
}
•
•
•
•
Originally Posted by mitchelltab
I'm having issues reading more then one line of data.
#include <stdio.h>
int main()
{
static const char filename[] = "file.txt";
FILE *file = fopen(filename, "r");
if ( file != NULL )
{
char line[32];
while ( fgets(line, sizeof line, file) != NULL )
{
char type;
int value;
if ( sscanf(line, "%c %d", &type, &value) == 2 )
{
printf("type = '%c', value = %d\n", type, value); /* test/debug */
/* do stuff */
}
}
}
else
{
perror(filename);
}
return 0;
}
/* file.txt
U 20
G 9
*/
/* my output
type = 'U', value = 20
type = 'G', value = 9
*/•
•
•
•
Originally Posted by mitchelltab
And and lost on how to put these items into tow arrays any help. please. I could get it to read from the file and out it on the display but not save to the file.
•
•
Join Date: Jul 2006
Posts: 17
Reputation:
Rep Power: 3
Solved Threads: 0
I can get it to read from the file. I need to get some help having it sort into the arrays. Can someone help me. I'm lost on how to get it to do that.
/*****************************************
File Name: Tmitchellwk2
Description: Calcutaing tuition based on Classification and number of
credits
Date: 7/18/06
Desinger: Tabatha Mithcell
Functions: Input, output
*****************************************/#include <stdio.h>
main ()
{
#define flatfeeone 500.00 /*flat rate for up to 6 credits*/
#define Flatfeeu 450.00 /*rate for undergrad rate for 6 to 12
credits*/
#define Flatfeeg 750.00 /*rate for graduate for 6 to 12 credits*/
#define flatunit 250.00 /*rate for fee per credit up to 6 credits*/
#define Flatunitu 245.00 /*rate for undergrate for 6-12 credits*/
#define Flatunitg 285.00 /*rate for graduate for 6-12 credits*/
#define Flatpuu 270.00 /*rate for undgrade for 12-18 credits*/
#define Flatgu 340.00 /*rate for graduate for 12-18 credit*/
#define Flatu 5100.00 /*rate for undgrade for 18 or more credits*/
#define Flatg 6400.00 /*rate for graduate for 18 or more credits*/
#define max 50 //max number of records
int credits; /*number of credits the person is taking*/
char status; /*Student status (G,g-Grad or U,u-Undergrad)*/
float cost; /*amount of tutition*/
int grad [max][2];//x,y any number
int under [max][2];//funstion for array of undergrads
FILE *indata, *outdata; //Input file and output files
indata = fopen ("e:\\LAB2IN.txt", "r");
outdata = fopen ("e:\\LAB2OUT.txt", "w");
if (indata == NULL)
printf ("Error openeing file\n");
else{
printf ("Status and Grades read from file:\n");
}
while (fscanf (indata, "%c" ,&status, "%d", &credits) != EOF)
{ //READ ONE STATUS
printf ("%c", status, "%d\n", credits);
if(status == 'G') //stating the calculations for grad
{
if ( (credits > 0) && (credits <= 6) )
cost = flatfeeone + (credits * flatunit);
if ((credits > 6) && (credits <= 12))
cost = Flatfeeg + (credits *Flatunitg);
if ((credits > 12) && (credits <=18))
cost = Flatgu * credits;
if (credits > 18)
cost = Flatg;
fprintf (outdata, "%c %d %.2f\n", under[max][0]);
printf ("%c %d %.2f\n", under[max][0]);
}
else if (status == 'U') //starting the calculations for undergrad
{
if ( (credits > 0) && (credits <= 6))
cost = flatfeeone + (credits * flatunit);
if ( (credits > 6) && (credits <= 12))
cost = Flatfeeu + (credits *Flatunitu);
if ( (credits > 12 ) && (credits <= 18))
cost = Flatpuu * credits;
if (credits > 18)
cost = Flatu;
fprintf (outdata, "%c %d %.2f\n" , grad[max][0]);
printf ("%c %d %.2f\n" , grad[max][0]);
}
}
fclose (indata); //close the indata file
fclose (outdata); //close the indata file
printf ("Output file is compelete.");
getchar();
getchar();
return 0;
}
•
•
Join Date: Jul 2005
Posts: 1,095
Reputation:
Rep Power: 9
Solved Threads: 141
int grad [max][2];//x,y any number
int under [max][2];//funstion for array of undergrads
These are two dimensional arrays. Why in the world do you need that? Just us a single dimensional array of size max for each.
In reality to you could compare each new tuition to current max and min tuition as it is calculated. You could even calculate the average tuition on the fly, if you wanted. However, the instructions require you to keep track of the tuitions in an array, and then describe the contents of the array. You can loop through the array to find the high and low, and if you keep track of how many tuitions are stored in the array it shouldn't be hard to calculate the average.
int under [max][2];//funstion for array of undergrads
These are two dimensional arrays. Why in the world do you need that? Just us a single dimensional array of size max for each.
In reality to you could compare each new tuition to current max and min tuition as it is calculated. You could even calculate the average tuition on the fly, if you wanted. However, the instructions require you to keep track of the tuitions in an array, and then describe the contents of the array. You can loop through the array to find the high and low, and if you keep track of how many tuitions are stored in the array it shouldn't be hard to calculate the average.
int under[max];
.
.
.
if (credits > 18)
cost = flatg;
//write amount of tuition to file
fprintf (outdata, "%d", cost);
under[i] = cost; //store tuition in array for undergraduate tuition at whatever index is appropriate. Last edited by Lerner : Jul 31st, 2006 at 12:29 pm.
•
•
•
•
Originally Posted by mitchelltab
while (fscanf (indata, "%c" ,&status, "%d", &credits) != EOF)
•
•
Join Date: Jul 2006
Posts: 17
Reputation:
Rep Power: 3
Solved Threads: 0
I need to have it sorted into tow arrays first and save to a file. That is where i'm having my issues.
•
•
•
•
Originally Posted by Lerner
int grad [max][2];//x,y any number
int under [max][2];//funstion for array of undergrads
These are two dimensional arrays. Why in the world do you need that? Just us a single dimensional array of size max for each.
In reality to you could compare each new tuition to current max and min tuition as it is calculated. You could even calculate the average tuition on the fly, if you wanted. However, the instructions require you to keep track of the tuitions in an array, and then describe the contents of the array. You can loop through the array to find the high and low, and if you keep track of how many tuitions are stored in the array it shouldn't be hard to calculate the average.
int under[max]; . . . if (credits > 18) cost = flatg; //write amount of tuition to file fprintf (outdata, "%d", cost); under[i] = cost; //store tuition in array for undergraduate tuition at whatever index is appropriate.
![]() |
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
•
•
•
•
•
•
•
•
DaniWeb C Marketplace
Similar Threads
- Recursive Fibonacci (C)
- c home work (C)
- set me some home work plz (C++)
Other Threads in the C Forum
- Previous Thread: software bundle
- Next Thread: Ask Function problem?thanks



Linear Mode