CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Oct 2010
    Posts
    98

    Question guide me for this

    hi

    I'm creating a file. Please tell me about the highlighted lines.

    Code:
    #include <iostream>
    #include <fstream>
    
    int main()
    {
    	using namespace std;
    	char automobile[40];
    	int year;
    	double price1;
    	double price2;
    	ofstream fileOut;
    	fileOut.open("aash.txt");
    	cout<<"Enter the make and model of automobile:";
    	cin.getline(automobile,40);
    	cout<<"Enter the model year:";
    	cin>>year;
    	cout<<"Enter the original asking price:";
    	cin>>price1;
    	price2=0.913*price1;
    
       cout<<fixed;
       cout.precision(2);
       cout.setf(ios_base::showpoint);
    	cout<<"Make and model:"<<automobile;
    	cout<<"Year:"<<year;
    	cout<<"Was asking:"<<price1;
    	cout<<"Now asking:"<<price2;
    
    	fileOut.close();
    
    	return 0;
    }

    many thanks!!

  2. #2
    Join Date
    Jan 2006
    Location
    Belo Horizonte, Brazil
    Posts
    405

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured