Please help me

How to insert the function on this program>
#include<iostream>
using namespace std;

struct Student_Record{
int id_num;
int assignment;
int quiz;
int test;
char grade;
};
void get_data(Student_Record &p);
int calc_mark(Student_Record p);
Student_Record read_data();
void print_all(const struct Student_Record p{});

int main()
{
Student_Record amir,naim, amirNaim[2];
int amirtotal_mark, naimtotal_mark;

get_data (amir);
amirtotal_mark=calc_mark(amir);
if (amirtotal_mark>=60)
amir.grade ='p';
else
amir.grade='F';

naim= read_data();
amirNaim[0]=amir;
amirNaim[1]=naim;

naimtotal_mark=calc_mark(amirNaim[1]);
if (naimtotal_mark>=60)
amirNaim[1].grade='P';
else
amirNaim[1].grade='F';

print_all(amirNaim);

system("pause");
return 0;
}
no people knowing this
What do you meant by "insert the function"?
this question is complete the program.The program ask the user to enter mark for assignment,quiz and test for amir and naim,the calculates the total mark using simple formula (assignment+quiz+test)/3.Finally the program print report card for both students and the report display all content of the structure.You required to write definitions for the given 4 function performing task in the program.
So you want us to do your homework for you?
want to ask how to solve this i try but nothing happen...
want to ask who expert ....about this program
Start by considering what you need each method to do. The assignment has given you descriptions for each; how would you translate that into code?
i not expert about c++ can you guide me...
Not if you don't even look like you've made an attempt.
i know

int calc_mark(Student_Record p);
{
int assignment;
int quiz;
int test;
amirtotal_mark=(assignment+quiz+test)/3;

return amirtotal_mark;
}
Last edited on
void get_data(Student_Record &p);
{
int id_num;
int assignment;
int quiz;
int test;

cout<<"ID num: ";
cin>>id_num;
cout<<"Assingment: "
cin>>id_num
cout<<"Quiz: "
cin>>quiz;
cout<<"Test";
cin>>test;
}
this what i done

void get_data(Student_Record &p);
{
int id_num,assignment,quiz,test;

cout<<"Put id num : ";
cin>>id_num;
cout<<"Assignment mark:";
cin>>assingment;
cout<<"Quiz mark: "
cin>>quiz;
cout<<"Test Mark: "
cin>>mark;
}
int calc_mark(Student_Record p)
{
int assignment,quiz,test;
amirtotal_mark=(assignment+quiz+test)/3
return amirtotal_mark;
}
Student_Record read_data()
{
cout<<id_num;
cout<<assignment;
cout<<quiz;
cout<<test;
}
void print_all(const struct Student_Record p{})
{
cout<<Student_Record.id_num;
cout<<Student_Record.assigment;
cout<<Student_Record.quiz;
cout<<Student_Record.test;
cout<<Student_Record.grade;
}
This not correct
Topic archived. No new replies allowed.