Answer to Question #58993 in C++ for aventador
Figure below shows that Student is a structure consisting of four different objects. The figure below illustrates how a struct is declared, how its constituent data members are accessed, and how it can be passed as a parameter to a function. You need to calculate the grade point average from the given pointer1 and pointer2. We have the declaration:
Write a program that produce an output that will call struct Student for last name, first name, pointer1 and pointer 2 for a student named Mary.
using namespace std;
cout << "Last name " << lastName << " first name " << firstName << " pointer1 " << pointer1 << " pointer2 " << pointer2 << endl;
double aver(Student s);
Mary.firstName = "Mary";
Mary.lastName = "Green";
Mary.pointer1 = 5;
Mary.pointer2 = 4;
cout << aver(Mary) << endl;
double aver(Student s)
return (double)(s.pointer1 + s.pointer2) / 2.0;
Need a fast expert's response?Submit order
and get a quick answer at the best price
for any assignment or question with DETAILED EXPLANATIONS!