#include<iostream.h>
#include<fstream.h>
float voltage;//assign memory space
float pressure;
void main()
{
cout<<"Enter the voltage reading: >>>";//get input
cin>>voltage;
//convert voltage to pressure
pressure=((voltage*20)+500);
if(pressure>=700)
{
cout<<"\n*************** WARNING THE PRESSURE IS ABOVE RECOMENDED LEVELS!****************"<<endl;
}
/******************** store reading ************************/
//setup new output stream (call it outfile)
ofstream outfile;
//target it to a text file
//then open it ready for data transfer
outfile.open("C:\\pressure.txt");
//send data
outfile<<pressure<<endl;
cout<<endl<<"file written\n";
outfile.close();//do I need this with a write file???
/********************************/
cout<<"temp print out of pressure "<<pressure<<endl<<endl;
}//end main