Answer:
Following are the program in c++
;#include <iostream> // header file
#include <string>
using namespace std;
class student // class
{
public:
int ID,age ; // variables
string courseStudentsname;
student() // constructor initialize the member
{
courseStudentsname="Smith";
age=20;
ID=9999;
}
void PrintAll() //PrintAll() function
{
cout << "Name: " <<courseStudentsname;
cout << ", Age: " << age;
cout << ", ID: " << ID;
}
};
int main() // main function
{
student e; // create object and call default constructor
e.PrintAll(); // call the PrintAll() function
return 0;
}
Explanation:
In the given program we create a three variable inside the class student and declared three variable ID,age of int type and courseStudentsname of string type after that we create a constructor and initialize them as value is given in question and finally create a PrintAll member function which separate cout statement to output .In the main function create a object class student and call the PrintAll function.
Output:
Name: Smith, Age: 20, ID: 9999