Question
#include #ifndef STUDENT_H #define STUDENT_H using namespace std; class Student { private: string name; // represents the name of the student int age; // represents
#include
using namespace std; class Student { private: string name; // represents the name of the student int age; // represents the age of the student double gpa; // represents the GPA of the student public: //default Constructor Student() {} // Parametrized Constructor to set the student name, age and GPA Student(string name, int age, double gpa) { this->name = name; this->age = age; this->gpa = gpa; }
// display function to print the student details void display() { cout << "Name : " << name << endl << "Age: " << age << endl << "GPA: " << gpa; } }; #endif
StudentImpl.cpp
********************************
#include
#include "Student.h"
using namespace std;
int main() { cout << "Enter the number of students: "; int n; cin >> n; Student students[n];
// Get all the student details for(int i=0; i
cout << " The students details are : "; for(int i=0; i return 0; } this wont compile on microsoft visual studio. acan somwonw tweak this or help me understand why it doesnt workim getting 6 error codes
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started