Array and parameters

hello everyone...
i'm trying to call my cumputation in PRELIM ,MIDTERM , FINAL in my code but I don't know if there's something in my parameters.. it's just showing me this error "[Error] expected primary-expression before 'first name'". in line 45.



#include <iostream>
#include <fstream>
#include <string.h>
#include <conio.h>
#include <iomanip>
using namespace std;

void AppendFile(string id,string firstname,string lastname,float marks,float sum);
void ComputeGrade(string id,string firstname,string lastname,float marks,float sum);
void BrowseFile();
void FindRecord();
void ViewProfile();
void Start();
void Back();

float total_marks(float []);

int main()
{
system ("color 5F");
system ("cls");
cout << "\t==============================================================" << endl;
cout << "\t| NORTHERN COLLEGE OF INFORMATION TECHNOLOGY AND COMPUTING |" << endl;
cout << "\t==============================================================" << endl << endl;
Start();

getch();
}
void Start(string id,string firstname,string lastname,float marks,float sum)
{
int choice;
back:
cout<<" NCITC Grade Portal :"<<endl;
cout<<"\t[1] Append Record "<<endl;
cout<<"\t[2] Browse all file contents "<<endl;
cout<<"\t[3] Find a record "<<endl;
cout<<"\t[4] Exit "<<endl;
cout<<"\t[5] About \n"<<endl;
cin>>choice;

switch (choice)
{
case 1:
system("cls");
AppendFile(string id,string firstname,string lastname,float marks,float sum);
Back();
break;
case 2:
system("cls");
BrowseFile();
Back();
break;
case 3:
system("cls");
FindRecord();
Back();
break;
case 4:
system("cls");
cout<<" Thank you . . .";
break;
case 5:
system("cls");
void ViewProfile();
break;
default:
cout<<"Invalid Entry ! . . . Try Again . . .\n";
system("cls");
break;
goto back;
system("cls");
}
}
void AppendFile(string id,string firstname,string lastname,float marks,float sum)
{
string id , firstname , lastname;
ofstream myfile;
myfile.open ("NCITC.txt");
cout<<" Student ID : ";
cin>> id;
cout<<"\n Student Name : ";
cin>>firstname>>lastname;

float marks[3][4]={0};

cout<<"\n Enter the marks of the student : "<<endl;

for(int count_1=0 ; count_1 < 3 ; count_1++)
{
cout<<"[1] = PRELIM\n"<<"[2] = MIDTERM\n"<<"[3] = FINAL\n";
cout<<"\n Enter the marks obtained by student in ["<< count_1+1 <<"] :"<<endl;
cout<<"\t Attendance/Assignment 10% (No. of Presence in 30 days)= ";
cin>>marks[count_1][0];

cout<<"\t SW/Labe Exercises 20% (total of 100)= ";
cin>>marks[count_1][1];

cout<<"\t Quizzes 30% (total of 150)= ";
cin>>marks[count_1][2];

cout<<"\t Exam 40% (total of 60)= ";
cin>>marks[count_1][3];

cout<<" ================================* RESULT *==============================\n\n";
cout<<" Attd/Assign 10% =|= SW/Labe Exercises 20% =|= Quizzes 30% =|= Exam 40% \n\n";
for(int count_2=0;count_2<10;count_2++)
{
cout<<setw(11)<<(count_2=(marks[count_1][0] / 30 *.10)*100)<<"%";
cout<<setw(19)<<(count_2=(marks[count_1][1] / 100 *.20)*100)<<"%";
cout<<setw(22)<<(count_2=(marks[count_1][2] / 150 *.30)*100)<<"%";
cout<<setw(15)<<(count_2=(marks[count_1][3] / 60 *.40)*100)<<"%";
cout<<endl<<endl<<endl;
}

float sum=0;
for(int count=0;count<4;count++)

sum=(sum+marks[count_1][count]);
return sum;
cout<<endl<<endl;

}
ComputeGrade( id, firstname, lastname, marks, sum);
}
void ComputeGrade(string id,string firstname,string lastname,float marks,float sum)
{
cout<<"\n\n PRELIM GRADE 30% : "<<((sum / 4 *.30/100)*100)<<endl;
cout<<"\n\n MIDTERM GRADE 30% : "<<((sum / 4 *.30/100) *100)<<endl;
cout<<"\n\n FINAL GRADE 40% : "<<((sum / 4 *.30/100) *100)<<endl;
myfile<< id<< ", " << firstname<< " " << lastname << " , " << endl;
myfile << fixed;
myfile.close();
}
void BrowseFile()
{
string line;
ifstream x ("NCITC.txt");

if (x.is_open())
{
while(!x.eof())
{

cout<<endl;
getline(x,line);
cout<<line<<endl;

}
x.close();
}
else
cout<<"Cant open file. . ."<<endl;
}
void FindRecord()
{
ifstream data("Xboss.txt");
string item,line;
int x=0;
int y=0;
string id;

cout<<endl;
cout<<"Enter Student Id: ";
cin>>id;
cout<<""<<endl;

while(!data.eof())
{
getline(data,line);
string item_array[10];
stringstream stream(line);
x=0,y=0;

while(getline(stream,item,','))
{
item_array[x]=item;
x++;
item_array[y]=item;
y++;
}

if(item_array[0]==id)
{
cout<<setfill('-')<<left<<setw(10)<<"\t\t\tID: " <<right<<" "<<item_array[0]<<endl;
cout<<setfill('-')<<left<<setw(10)<<"\t\t\tName: " <<right<<" "<<item_array[1]<<endl;
cout<<setfill('-')<<left<<setw(10)<<"\t\t\tGrade: " <<right<<" "<<item_array[2]<<endl;
cout<<""<<endl;
}
}
data.close();
}
void ViewProfile()
{
cout<<endl;
cout<<" Your School Here "<<endl;
cout<<" Addres here "<<endl;
cout<<" Contact number"<<endl;
cout<<" Subject"<<endl;

back();
}
void Back()
{
string choice;
cout<<""<<endl;
cout<<"Do you want to make another choice?(yes/no)";
cin>>choice;
system("cls");
cout<<""<<endl;
if (choice=="yes")
{
start();
}
else if(choice=="no")
{
cout<<" Thankyou and have a nice day !...";
}
}
















Line 3. Wrong header. <string.h> is a C header. You want <string> for C++.

Line 45: You're supplying type names on a function call. Type names are not allowed in function calls.

Line 76, 84: You're declaring variables already declared as arguments. You can't do that. The compiler reports duplicate definitions.

Line 84: marks is declared as a simple float in the argument list. Here you're trying to declare it as an array. You can't have it both ways.

Line 119: AppendFile is declared a void function, but you're trying to return a value.

Lines 130-132: myfile is not defined.

Line 171: You're trying to use a stringstream, but you did not include the <sstream> header.

Line 201: No forward declaration for back().

Line 213: start is not defined.

PLEASE USE CODE TAGS (the <> formatting button) when posting code.
It makes it easier to read your code and also easier to respond to your post.
http://www.cplusplus.com/articles/jEywvCM9/
Hint: You can edit your post, highlight your code and press the <> formatting button.
thank you so much.... my code is better now...
Topic archived. No new replies allowed.