66 935
Assignments Done
Successfully Done
In October 2018

Answer to Question #45674 in C++ for Anjana Ramanan

Question #45674
write a program to create a base class students with data member, name and rollno to class test and store derived from students details contain test mark and sports contain sports mark.
Expert's answer
#include <iostream>
class Student{
  std::string name;
  int rollNo;
  Student(const std::string name, int number) {
this->name = name;
this->rollNo = number;
  std::string getName() {
return name;
  int getRollNo() {
return rollNo;
class Test : public Student {};

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!


No comments. Be first!

Leave a comment

Ask Your question

Privacy policy Terms and Conditions