Need help creating this to these instructions, mainly with the part where I call an existing files that has already been created and saved in Notepad as attached.(File one and File two). Below are the directions and some code. I think you will be able to tell what I’m trying to do, Thanks
Requirements:
Create a program to output the following. Make sure it is exact (except for the commission and percentage values):
Commissions calculated using a 0.07 value.
Sales Name Commission
See attachments(2)
This will be accomplished using the following:
1. Read the sales and name values from two input files.
2. Create an array of names and sales amounts (5 total).
3. Determine the commission by randomly generating a percentage number between .05 and. 10. Calculate the commission by multiplying this value times the sales amount.
4. Sort the file by name before printing.
5. Print the file to a third output file. The only thing that should show on the screen is the successful message.
6. Main should have no logic other than calling other functions. All actions should be done in functions (print, read files, sort).
Code:
#include <iostream>
#include <iomanip>
#include <cmath>
#include <fstream>
using namespace std;
ofstream OutFile("A:\\File one.out");
ifstream InFile("A:\\File one.in");
const int ARRAY_SIZE = 5;
void PrintArray(double[ARRAY_SIZE][25], int ARRAY_SIZE);
void BubbleSort(double[ARRAY_SIZE][25], int ARRAY_SIZE);
void GetNames(double[ARRAY_SIZE][25], int ARRAY_SIZE);
int main()
{
int arraySales[ARRAY_SIZE][25];
char arrayNames[ARRAY_SIZE][25];
return 0;
}