Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

#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 #ifndef STUDENT_H #define STUDENT_H

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> name; int age; cout << "Age : "; cin >> age; cout << "GPA : "; double gpa; cin >> gpa; // create a new student with the user data Student s(name, age, gpa); // insert the student to the list of students students[i] = s; }

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Oracle Autonomous Database In Enterprise Architecture

Authors: Bal Mukund Sharma, Krishnakumar KM, Rashmi Panda

1st Edition

ISBN: 1801072248, 978-1801072243

More Books

Students also viewed these Databases questions