Im having a compiler error: "expected unqualified id before '{' token" on line 94
It seems all my brackets are in tact but I can't find a solution to this problem
#include <iostream>
#include <fstream>
#include <iomanip>
#include <string>
using namespace std;
const int ALIASFILE_LINE_COUNT =16;
const float USERBONUSLEVEL = 75.09;
const float USERAWARDLEVEL = 80.72;
const int USERBONUS = 5;
const int USERAWARD = 8;
const int ARRAY_SIZE = 20;
void selectionSortDec( double list[], int length);
void selectionSortAsc(double list[], int length);
void printArray( const double list[],const int length);
void loadArray(fstream& in, double list[],const int length);
string inputFileName;
string outputFileName;
string Time;
string Name;
string Alias;
string UserID;
ifstream inFile;
ofstream outfile;
double price=0, sum=0, max=0, min =0;
double average=0, roundedaverage=0;
double ITEM_COUNT=0;
double number=0;
int main()
{
double myArray[ARRAY_SIZE]={0};
int index=3;
cout <<"\n\nproject 3"<<endl;
cout<<"Enter full name:";
getline(cin, Name); // full name
cout<<"Enter \Alias\:";
cin >> Alias; //alias
//gender
cout<<"Enter user ID: ";
cin >> UserID; // ID// rating
cout<<"Enter items file name:";
cin >> inputFileName;
inFile.open(inputFileName.c_str());
if(!inFile){
cout<<"\nProject 1 ERROR Opening Input File!! Exiting!\n\n"<<endl;
return 0;
}
outputFileName =Alias + ".txt";
outfile.open(outputFileName.c_str());
if(!outfile){
cout<<"\nProject 1 ERROR Opening OUTPUT File!! Exiting!\n\n"<<endl;
return 0;
}
cout<<"full name:" << setw(12)<<Name<<endl;
cout<<"Alias: " <<setw(12)<<Alias<<endl;
cout<<"UserID : " <<setw(12)<<UserID<<endl;
outfile<<"full name:" << setw(12)<<Name<<endl;
outfile<<"Alias: " <<setw(12)<<Alias<<endl;
outfile<<"UserID : " <<setw(12)<<UserID<<endl;
inFile>>number;
inFile>> price;
inFile>> ITEM_COUNT;
getline(inFile, Name);
}
{
void printArray( const double list[],const int length){
for(int index=0; index<length; index++)
cout << list[index] <<" ";
}
void loadArray(fstream& in, double list[],const int length){
for(int index=0; index<length; index++)
in>>list[index];
}
cout <<"\n___________________________________________________________\n";
cout <<setw(6)<<"\nWEEK\t\t(ordered low to high -->) ";
void selectionSortAsc(double list[], int length){
double temp;
int index;
int smallestIndex;
int minIndex;
for (index = 0; index < length - 1; index++)
{
smallestIndex = index;
for (minIndex = index + 1; minIndex < length; minIndex++)
if (list[minIndex] < list[smallestIndex])
smallestIndex = minIndex;
temp = list[smallestIndex];
list[smallestIndex] = list[index];
list[index] = temp;
}
}
cout <<"\n____________________________________________________________\n";
cout <<"\nWEEK avg high low";
void selectionSortDec( double list[], int length){
int index=0, smallestIndex=0, minIndex=0;
double temp=0;
for (index = 0; index < length - 1; index++)
smallestIndex = index;
for (minIndex = index + 1; minIndex > length; minIndex++)
if (list[minIndex] > list[smallestIndex])
smallestIndex = minIndex;
temp = list[smallestIndex];
list[smallestIndex] = list[index];
list[index] = temp;
cout <<"\n___________________________________________________________\n";
cout<<setw(14);
cout <<"\n___________________________________________________________\n";
inFile.close() ;
outfile.close() ;
}
cout<<"\n\n\n";
}
return 0;