try it by user self. its very easy to implement. if you have doubt to continue 
further please ask. 



~vishnu~


----- Original Message ----
From: asd dfds <[EMAIL PROTECTED]>
To: [email protected]
Sent: Thursday, 3 July, 2008 12:16:22 PM
Subject: Re: [c-prog] need a sample programme




hi i need  this simple programe plz send me if you are a good programer 
thanks.shan_ [EMAIL PROTECTED] com

Programe:Write a C++ program that contains a class named Student having 
following data members: 

1.      stdId
2.      stdName
3.      stdAge
4.      stdProgram
5.      noOfSubjects. 

The class Student must have

•       A default constructor which must initialize all the data members to 
their meaningful values.
•       A parameterized constructor which takes values for all the data members 
as parameters and assign them to their respective fields in class.
•       A destructor with no implementation.
•       Setter member functions to set all data members (stdId, stdName, 
stdAge, stdProgram, and noOfSubjects) .
•       Getter member functions to get all data members (stdId, stdName, 
stdAge, stdProgram and noOfSubjects) .
•       Display() member function to display the data for each student. 
•       Friend function of class that receives an object of type “Student” 

Display() member function takes no parameters and displays all the student‘s 
information on the output screen.

Friend function of class receives an object of type “Student” and determines 
whether a student has registered in more than five subjects or not. 
If a student registers in more than five subjects then it should display a 
message that “Student has registered in more than 5 subjects” and if a student 
does not register in more than 5 subjects then it should display a message that 
“Student has not registered in more than 5 subjects”. 

In main function of the program

•       Dynamically allocate memory for two objects of type “Student”. 
•       Prompt the user to enter data for each student and store into an object 
of type “Student”. 
•       After setting data for each student, display the data for each student 
by calling display method. 
•       Determines whether a student has registered more than five subjects or 
not by calling friend function.
•       Deallocate memory that was allocated to objects 

Sample Output of Program:

Please enter data for student 1

Student ID:               std01
Student Name:             Sadia 
Student Age:              18
Student Program:          BCS 
Number of Subjects:       3

Please enter data for student 2

Student ID:               std02 
Student Name:             Sidra
Student Age:              17
Student Program:          BBA
Number of Subjects:       6

Displaying records for registered students

Record for Student 1

Student ID:               std01
Student Name:             Sadia 
Student Age:              18
Student Program:          BCS
Number of Subjects:       3

Record for student 2

Student ID:               std02 
Student Name:             Sidra
Student Age:              17
Student Program:          BBA
Number of Subjects:       6

Student 1 has not registered in more than 5 subjects
Student 2 has registered in more than 5 subjects

    


      Download prohibited? No problem. CHAT from any browser, without download. 
Go to http://in.messenger.yahoo.com/webmessengerpromo.php/

[Non-text portions of this message have been removed]

Reply via email to