Latest Activity In Study Groups

Join Your Study Groups

VU Past Papers, MCQs and More

We non-commercial site working hard since 2009 to facilitate learning Read More. We can't keep up without your support. Donate.

CS201 - Introduction to Programming Assignment No. 2 Solution and Discussion Spring 2014 of Virtual University (VU) Due Date: July 14, 2014

Please read the following instructions carefully before submitting assignment. It should be clear that your assignment will not get any credit if:

  • The assignment is submitted after due date.
  • The submitted assignment does not open or file is corrupt.
  • Assignment is copied(partial or full) from any source (websites, forums, students, etc)

Note: You have to upload only .cpp file. Assignment in any other format (extension) will not be accepted and will be awarded with zero marks. For example, if you submit code in .doc (Word document) or .txt files or .exe file, no reward will be given in any case.


The objective of this assignment is to provide hands on experience of:

  • Basic concepts of C/C++ classes and objects
  • Dealing with Data members and member functions
  • Initialization of objects
  • Constructor
  • Destructor


  • Code should be properly indented and well commented.
  • Follow C/C++ rules while writing variable names, function names etc
  • Use only dev-C++ for this assignment.

Assignment Problem Statement:

You are required to write a C++ program which contains a class studentInfo having following data members:

  • Student ID
  • Course ID
  • Course Name

The class must have the following member functions:

• Parameterized constructor
• Setter functions
• Getter functions
• Display function

Detailed Description:

Parameterized constructor: It should take three strings as arguments (Student Id, Course Id and Course Name) and initializes the data members of class using setter functions
Setter functions: There must be a setter function for each data member of class
Getter functions: There must be a getter function for each data member of class
Display function: It should display the values of each data member of class by calling getter functions.

Within main() function, create an object of studentInfo class by using the parameterized constructor and pass three strings (student id, course id and course name) as arguments to this parameterized constructor. Then, call the display function which will display the values of student id, course id and course name.

You must display your own VU Id.

Sample output of program:

Views: 9629


Replies to This Discussion

Please Discuss here about this assignment.Thanks

Our main purpose here discussion not just Solution

We are here with you hands in hands to facilitate your learning and do not appreciate the idea of copying or replicating solutions.

help plzzzzzzzzzzzzzzzz




its really gud work..

Now, just

1_change variables,

2_Cut uper n lower part of commenting made by Lion.

3_ in main function,

StudentInfo s1 ( "LION", "cs201", "introduction to programming");

here give ur own VU ID.

4_ change cout "\n\t ------Hit Any Key to EXIT----";


cout "Press any key to continue...";

if u want to do..

Best of Luck..

yes you are right 



///////////////////// Say Thanks 2 LION ------------- X Student of CS201 /////////////////////////////

#include <conio.h>

using namespace std;

class StudentInfo{

char * studentID;
char * courseID;
char * courseName;

// Parameterized constructor
StudentInfo(char *,char *,char *);

// Standard Setter Function
void setStudentID(char *);
void setCourseID(char *);
void setCourseName(char *);

// Standard Getter Funtion
char getStudentID();
char getCourseID();
char getCourseName();

void display();

// Definition of all Functions
// Conctructor
StudentInfo::StudentInfo(char *studentID,char *courseID, char *courseName)

// setter function fo StudentID
void StudentInfo::setStudentID(char * studentID){
this->studentID = studentID;

// Setter Function of Course ID
void StudentInfo::setCourseID(char * courseID){
this->courseID = courseID;

// Setter Function for Course Name
void StudentInfo::setCourseName(char * courseName){
this->courseName = courseName;

// Getter Function for StudentID
char StudentInfo::getStudentID(){
return *studentID;

// Getter Function of course ID
char StudentInfo::getCourseID(){
return * courseID;

// Getter Function for Course Name
char StudentInfo::getCourseName(){
return *courseName;

// Display func
void StudentInfo::display(){
cout endl endl;
cout"\n Student ID : " studentIDendl;
cout"\n Course ID : " courseID endl;
cout"\n Course Name: " courseNameendl;
// End of Class Definition

StudentInfo s1 ( "LION", "cs201", "introduction to programming");

cout endl;
cout "\n\t ------Hit Any Key to EXIT----";

// Good Bye Students ....... See this and try to make ur own...... Enjoy.............................
// ------------------ #Lion #theBadBoy

Lion  thanks for sharing 

kindly help on this assigmnt...


please submit the solution of assignment 


© 2021   Created by + M.Tariq Malik.   Powered by

Promote Us  |  Report an Issue  |  Privacy Policy  |  Terms of Service