ComputerScienceExpert

(11)

$18/per page/

About ComputerScienceExpert

Levels Tought:
Elementary,Middle School,High School,College,University,PHD

Expertise:
Applied Sciences,Calculus See all
Applied Sciences,Calculus,Chemistry,Computer Science,Environmental science,Information Systems,Science Hide all
Teaching Since: Apr 2017
Last Sign in: 103 Weeks Ago, 3 Days Ago
Questions Answered: 4870
Tutorials Posted: 4863

Education

  • MBA IT, Mater in Science and Technology
    Devry
    Jul-1996 - Jul-2000

Experience

  • Professor
    Devry University
    Mar-2010 - Oct-2016

Category > Programming Posted 02 Jun 2017 My Price 8.00

Lecturer wants this as the header file

I need an example of how I might replace 'void' with 'string' in a class. Lecturer specifically wants us to use string. Attached is the scenerio

Thanks

 

Lecturer wants this as the header file:using namespace std;class BankAcct {public:BankAcct(int a, int b);string display();// member function to display toscreen account number and pinstring show();int get_acc_num();int get_pin_num();private:int account_number;int pin;};This is what I have written:using namespace std;class BankAcct {public:BankAcct(int a, int b);// constructor for bank account data.void display();// member function to display toscreen account number and pinint get_acc_num();int get_pin_num();private:int account_number;int pin;};BankAcct::BankAcct(int a, int b):account_number(a), pin(b) {}// accountnumber and pin number.void BankAcct::display() {// function to display account number and pin.cout<< endl <<"Account number: 324-001-"<< account_number <<"\n Pin code:"<< pin;}int BankAcct::get_acc_num() {return account_number;}int BankAcct::get_pin_num() {return pin;}

Attachments:

Answers

(11)
Status NEW Posted 02 Jun 2017 12:06 AM My Price 8.00

-----------

Not Rated(0)