In this class I have created a constructor...I call one member function (customer) in a another function (screen)...but the default value is displaying...to be more specific my default for user is "bookie"... but I call the member function customer to changer user to a name as in Taylor, or billy. why is the default displaying? user
So through the constructor you call these functions to initialize the data of the new BLUEBOX object?
They enter a value into ID, but you call the customers function with user? Aren't they going to be entering the 00, 01 etc. so that you can assign a value to user? I think you'd want to send what they enter in ID here.
1 2
cin >> ID;
customers(user);
Then check if j == "00" etc., not ID? j is a copy of the value you sent in. Then set user, not j, to "Billy" or "Taylor", not Billy or Taylor?
1 2 3 4 5 6 7 8 9 10 11 12 13
void BLUEBOX::customers(string j){
if (ID == "00")
j = Billy;
elseif (ID == "01") j = Edward;
elseif (ID == "12")
j = Taylor;
elseif (ID == "99") j = Admin ;
return;}
Are Admin, Billy, Edward, Taylor just examples of usernames? Here they are variable names with no initialized value.