student stdno:int nogen:staticint//student number generator name:string balance: double counter:staticint student ( ) //default constructor student ( string, double) //parameterized constructor...















student



stdno:int


nogen:staticint//student number generator


name:string


balance: double


counter:staticint



student ( ) //default constructor


student ( string, double) //parameterized constructor


student (conststudent &) //copy constructor


~student( )


getstdNo( ):intconst


getName( ): stringconst


getBalance( ): doubleconst


getNoGen( ): staticint


getCounter( ): staticint


withdraw( double ):void //balance should be updated


deposit( double): void //balance should be updated


printStdInfo( ): void//printsstdno, name and balance




Consider the instructions provided below and createstudent.h


Use “this” pointer in the entire class.

•Whenever a new student object is created, unique student id should be assigned to the student and the counter should be incremented by 1.•Default constructor: set default values to the necessary data members.•Parameterized constructor: name and balance of the student should be sent as parameters from main( )•Copy constructor: copies the name and balance of old student object to the new student object.•Withdraw: this method receives the withdraw amount as parameter and updates the balance!!! If student have not enough balance print an appropriate message.•Deposit: this method receives the deposit amount as parameter and updates the balance.•printStdInfo: prints student number, name and balance in a row-wise format.


FirstMain(): main function should include the following:

•Create an object that invokes default constructor,•Create another object that invoked the parameterized constructor,•Create one more object that copies the values of the first object.•Change the name and balance of the last object you have created. Add necessary methods to your class (setter methods)•Perform some operations on the second student object such as withdraw or deposit operations•Finally print all information of all objects you have created.•Display the number of students created in the program.(callprintstdInfo() method)

SecondMain(): Write separate main that will perform the following tasks:

•Create an array object (array of 10 students) (Make sure that default constructor is executed)•Change the name and the balance of all students in the array.•Print the information of all students (callprintstdInfomethod)
Nov 22, 2021
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here