Can someone please help me out...
Here's my code:
Code://Chris Adams //CIS 111 Lab Assignment # 6 //includes #include <fstream> #include <iostream> #include <cstdlib> #include <cmath> using namespace std; //void function declaration void process (ifstream& in_stream, ofstream out_stream); void costwd ( ); void costwe ( ); int time; int minutes; int cost; ifstream fin; ofstream fout; int main( ) { //local variable declarations //input/output files preparation fin.open("record.txt"); if (fin.fail( )) { cout << "Sorry, but the process of opening the input file failed.\n"; exit(1); } fout.open("bill.txt"); if (fout.fail( )) { cout << "Sorry, but the process of opening the output file failed.\n"; exit(1); } //calling void function process (fin, fout); fin.close( ); fout.close( ); //ending prorgram cout << "Ending process of editing preparing your phone bill.\n"; cout << "Thank You."; return 0; } //----------------------------------------------------------------------- //void function void add_name (ifstream& in_stream, ofstream out_stream) { //local void functions variable declarations char day; //process procedure for weekend while(!in_stream.eof()) { in_stream>>day; in_stream>>time; in_stream>>minutes; if (day != 'S') { void costwe ( ); } else { void costwd ( ); } //perform calculations and output //the variables and the calculations } //-------------------------------------------- //function call // void costwd ( ) *{ if( (time >= 8) && (time <= 18)) { cost = minutes * .40; } else { cost = minutes * .25; } fout << cost; } //============================== *void costwe ( ) { cost = minutes * .15; fout << cost; } *
1st & 2nd *: error C2601: 'costwd' : local function definitions are illegal
3rd *: fatal error C1004: unexpected end of file found
Can someone please help me out with this....
Thanks a million...