Please Help Me Sove This C++ Its urgent

Discussion in 'Software' started by ch_mshahid, Jul 7, 2008.

  1. ch_mshahid

    ch_mshahid

    Joined:
    Jul 7, 2008
    Messages:
    2
    Write a C++ program that contains a class named Student having following data members:



    stdId
    stdName
    stdAge
    stdProgram
    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
    ch_mshahid, Jul 7, 2008
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. FINNY
    Replies:
    1
    Views:
    434
    Pennywise@DerryMaine.Gov
    Nov 18, 2006
  2. Security Advisory

    !!URGENT!! Tor Vulnerability Discovered !!URGENT!!

    Security Advisory, Aug 6, 2007, in forum: Computer Security
    Replies:
    1
    Views:
    953
    http://tinyurl.com/23k3dt@$NIFF-deeply.ahh
    Aug 11, 2007
  3. ch_mshahid

    Please Help Its urgent C++ Code required

    ch_mshahid, Jul 7, 2008, in forum: General Computer Support
    Replies:
    1
    Views:
    759
    jcas1411
    Jul 31, 2008
  4. ankita.iitk

    Help Needed with this code...its URGENT!!

    ankita.iitk, Jul 7, 2008, in forum: General Computer Support
    Replies:
    0
    Views:
    602
    ankita.iitk
    Jul 7, 2008
  5. pooja
    Replies:
    0
    Views:
    1,176
    pooja
    Mar 3, 2009
Loading...

Share This Page