hi guys, i need help with this program. Need\'s a stack class that... push\'s po
ID: 3862678 • Letter: H
Question
hi guys, i need help with this program.
Need's a stack class that...
push's
pop's
isEmpty
makeEmpty
peek
print.
With my stack class, i'm going to #include it in my Facebook class, which should do this...
addFriend(): add's them since they are a stack object. meaning I use the push function in the stack class
removeFriend(): remove's them with the pop function, removing them from the list.
printFriends(): this simply enables the print() function from the stack
latestFriend(): we should use the peek() fuction, printing out the latest video
resetFriends(): I believe this will do the makeEmpthy() function to empty out the friends list
checkList(): and for this we use the isEmpty() function from the stack class
These Data members can be in there too I believe
"DataTyperUser" who is going to be friended
"Stack<DataType>FriendList" this can be the friendlist in the stack form, it doesn't have to be an array
"int numOfFriends" this will track all of the friends we have
Main Program
This will #include the Facebook class, and read president's and their home states,
I have them listed like this in a text file"
etc. goes all the way down to....
All I need to know is where to put this file name in the main program, please comment where I can put that file.
With the president and homestates, the Facebook Class options should be able to this
AddFriend, should push them all into a FriendList. We want all presidents to be our friend
LatestFriend, this will print out the recent president and homestate
that sohuld come up.
All these abilities in the facebook class should work on presidents. (like ResetFriends, PrintFriends) etc, but for presidents!
i appreciate any help I can get. thank you.
Explanation / Answer
Try to read the txt file while you initialize your object for facebook class.that is when you include Facebook class,you might be creating instance/object for Facebook class,place this code for reading txt file in Facebook class constructor and store it in global variable or pass those values to Main program for further processing.
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.