Please visit our sponsor
UNKNOWN //************************************** //INCLUDE files for :Profile Creator //************************************** iostream.h, ofstream.h //************************************** // Name: Profile Creator // Description:It asks you name, age, height, etc. and puts them in a *.txt file... // By: Pat Underwood // // // Inputs:None // // Returns:None // //Assumes:None // //Side Effects:None //This code is copyrighted and has limited warranties. //Please see http://www.Planet-Source-Code.com/xq/ASP/txtCodeId.303/lngWId.3/qx/vb/scripts/ShowCode.htm //for details. //************************************** #include <iostream.h> #include <fstream.h> ///////////////////////// //Made By Pat Underwood// //http://patu.iwarp.com// ///////////////////////// int age, heightin, heightft; char firstname[30]; char lastname[30]; char gender[7]; ofstream foo("profiles.txt"); void main () { //Start questioning cout &lt;&lt; "Enter your first name:\n"; cin &gt;&gt; firstname; cout &lt;&lt; "Enter your last name:\n"; cin &gt;&gt; lastname; cout &lt;&lt; "Enter your gender (male or female):\n"; cin &gt;&gt; gender; cout &lt;&lt; "Enter your age:\n"; cin &gt;&gt; age; cout &lt;&lt; "Enter your height (feet only) :\n"; cin &gt;&gt; heightft; cout &lt;&lt; "Enter your height (inches only) :\n"; cin &gt;&gt; heightin; //Start confimation cout &lt;&lt; "-" &lt;&lt; firstname &lt;&lt; lastname &lt;&lt; "\n"; cout &lt;&lt; "-" &lt;&lt; gender &lt;&lt; "\n"; cout &lt;&lt; "- Age = " &lt;&lt; age &lt;&lt; "\n"; cout &lt;&lt; "-" &lt;&lt; heightft &lt;&lt; "' " &lt;&lt; heightin &lt;&lt; "''\n"; foo &lt;&lt; "Name: " &lt;&lt; firstname &lt;&lt; " " &lt;&lt; lastname &lt;&lt; "\n"; foo &lt;&lt; "Gender/Sex: " &lt;&lt; gender &lt;&lt; "\n"; foo &lt;&lt; "Age: " &lt;&lt; age &lt;&lt; "\n"; foo &lt;&lt; "Height: " &lt;&lt; heightft &lt;&lt; "' " &lt;&lt; heightin &lt;&lt; "''\n"; cout &lt;&lt; "Thank you, your new profile is being created...\n"; cout &lt;&lt; "This program was made by Pat Underwood, you can get more of his software at \nhttp://patu.iwarp.com\n"; }