Posts
 
Reputation
Joined
Last Seen
0 Reputation Points
Unknown Quality Score

No one has voted on any posts yet. Votes from other community members are used to determine a member's reputation amongst their peers.

~3K People Reached
Favorite Forums
Favorite Tags
c++ x 20
Member Avatar for blcase

[code=cplusplus] bool fun1() {if (root) return doFun1(root); else return false;} bool doFun1(Node *ptr){ if(ptr->left) doFun1(ptr->left); if(ptr->right) doFun1(ptr->right); if(ptr->left) doFun1(ptr->left); ptr->data=ptr->data*7; if (ptr->data>500) cout<<.5*ptr->data<<endl; else if (ptr->data<50) cout<<5*ptr->data<<endl; return true;} int main( ) { Tree t; t.insert(14);t.insert(13);t.insert(31);t.insert(27);t.insert(12); t.fun1(); return 0;} [/code] I am trying to trace through this and the output …

Member Avatar for hacker9801
0
116
Member Avatar for blcase

Hey, i dont need any specific help but i was wondering if anyone could help me generate an idea for my project. basically i have to use queues, deques, and stacks in a programmable way. The exammple that was given in class (which we can't use) is a librarian takes …

Member Avatar for Jacky1
0
101
Member Avatar for blcase

ok exploring the STL <set> if you entered the values say 1 to 1000 in order would it auto balance?....i thought no but then a friend of mine told me about this "red and black" tree and if i test the result times to find an element (random and numeric …

Member Avatar for vijayan121
0
77
Member Avatar for blcase

i am trying to overload subtraction between two separate classes. Class Id is basically several strings such as the information of a voter database. Class Collect would be the collection of several class Id's in an array along with a total of Class Id's and the title of the collection …

Member Avatar for John A
0
142
Member Avatar for blcase

I am trying to overload the + and - operator for my class Collect class Collect is an array of movies (class Movie) so i need to add a movie to the array and subtract a movie from the array. the only way i know how to do code this …

Member Avatar for Agni
0
167
Member Avatar for blcase

[code=c++] #include <iostream> #include <string> #include "Movie.h" #include "Collect.h" using namespace std; int main() { Collect c1; c1.setTitle("BestofBest"); Movie m1, m2, m3("John Ford", "Stagecoach", "Western", 96, "G", "1939"); m1.set("David Lean", "Doctor Zhivago", "Historical", 200, "G", "1965" ); m2.setDirector("John Avildsen"); m2.setTitle("Rocky"); m2.setGenre("Sports"); m2.setLength(120); m2.setRating("G"); m2.setRelease("1976"); Movie m4(m2); cout << m4.getDirector() << …

Member Avatar for John A
0
100
Member Avatar for blcase

[code] class Movie{ private: string director,title,genre; public: Movie(){ director="";title="";genre="";} int main(){ Movie a();} [/code] I am having problems with my default constructor. my program compiles but it gives me a warning "warning C4930: 'Movie a(void)': prototyped function not called (was a variable definition intended?)" and if i try to run …

Member Avatar for Narue
0
2K
Member Avatar for blcase

[code] #include <iostream> #include <string> using namespace std; class Movie { private: string director, title, genre, cast, rating, release; int length; public: Movie(){ cout<<"constructor w/ no parameters called"<<endl; length=0;} Movie(string d, string t, string g, int l, string c, string r, string re){ director=d;title=d;genre=g;length=l;cast=c;rating=r;release=re;} string getDirector(); string getTitle(); string getGenre(); …

Member Avatar for Duoas
0
187