-
February 9th, 2013, 10:49 AM
#1
Class/private help with this uml?
So I'm trying to do a homework assignment, where I read a uml about a bank program, and just create it. It's been about 2 years since I've done any c++. I used to be very quick and talented with it. But i have a horrible retention rate.
Here is the UML.
I'm completely oblivious with these UMLs, never learned much about them. But I am giving it my best shot. So while working on Bank, the top one, i've come up with this so far.
Code:
#include <iostream>
#include <string>
using namespace std;
class bank
{ string name;
int routingNum;
private:
int createaccount(string, int);
};
int bank::createaccount(string name, int routingNum)
{ cout <<"--------Registration--------\n";
cout << "Please enter your name\n";
cin >> name;
cout << "Please enter your Routing Number\n";
cin >> routingNum;
return (name,routingNum);
cin.get();
cin.get();
}
int main()
{ bank bankk;
bankk.createaccount(name,routingNum);
cout<<"Thank you"<<bank.name();
return 0; }
I'm assuming that's what the uml wants. However I can't seem to access that private class. Idk why. I declared it as an object in the main. Can anyone assist please? And if possible point out as many errors as possible, need tons of criticism to get back into my c++ mind.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|