Hi, I'm new here, but sure could use some help. I'm trying to create a file, enter data and write the data to a file. I know I need to "write" the data to the file but not sure how to do that. My code is below. Should I use a cout function to do this? This is homework and I've read and reread the section on this, but still can't figure it out.
#include "stdafx.h"
#include <iostream>
#include <fstream>
using namespace std;
int main()
{
ofstream program3data;
outputFile.open("program3data.txt");
float num1, num2, num3, num4, num5;
cout << "Enter the first number: ";
cin >> num1;
cout << "Enter the second number: ";
cin >> num2;
cout << "Enter the third number: ";
cin >> num3;
cout << "Enter the fourth number: ";
cin >> num4;
cout << "Enter the fifth number: ";
cin >> num5;