All pastes #22881 Raw Edit

acting weird

public cpp v1 · immutable
#22881 ·published 2005-09-14 04:00 UTC
rendered paste body
/**************************** Russell (Trae) Barlow ****************************/#include <iostream>#include <string>#include <fstream>#include <stdlib.h>using namespace std;int main(){	string filename;	string firstname;	string lastname;	float gross;	float tax;	ifstream textfile;	do{		cout << "Enter the name of the file to process or exit to quit: ";		cin >> filename;		if(filename == "exit"){			return 0;		}		textfile.open(filename.c_str());		textfile >> firstname;		textfile >> lastname;		textfile >> gross;		textfile >> tax;				system("cls");		cout << firstname << ' ';		cout << lastname;		cout << " earned $" << gross << '.' << endl;		cout << '$' << gross * tax << " was taken out for taxes." << endl;		cout << firstname << ' ' << lastname << "'s net pay was $" << gross - (gross * tax) << endl;		textfile.open(filename.c_str());	}while(!textfile);}