No one has voted on any posts yet. Votes from other community members are used to determine a member's reputation amongst their peers.
7 Posted Topics
Hi all... For a project I have to create a small program that adds class data using templates. I've completed the project, but the output is not expected for the last cout in main. Here is the code: [code=cplusplus] #include <iostream> #include<string> using namespace std; template <class T> T add …
Hi all - hope your weekend is going well. I've got the following code. It compiles, but gives a warning about a stack overflow error in the istream& operator function. When running the program, it just continuously outputs "Enter ID for student." What am I missing that makes this recursive? …
I cannot get this program to compile. It is bombing at the Outfit::Outfit constructor. I am getting an error stating that it is missing argument list and also illegal left operand type. Can someone point me in the right direction? Cheers - Jason [code=c++] // Outfit class contains Dress and …
Hello everyone....again. I have a program that is using a queue. I have a class member function that is to traverse the queue, and output the smallest number in the queue. Pseudo for this function is: Compare the front and front->next. Whichever is smaller, keep it. Traverse the queue until …
If I'm reading your intentions with this program correctly -- to display the food and its corresponding calories -- you wouldn't necessarily want to do a bubble sort on parallel array. While it will work, it probably wouldn't give valid data. Use a 2D array for this
To any and everyone :) As stated in my title, this is a homework assignment, so I appreciate any help or suggestions that are given. Also, per the website rules, I have put effort to this, and I'm not asking anyone to just do my work. (The program compiles and …
One option is to use parallel arrays. It's important to remember that if you delete or move a subscript in either array, its corresponding subscript in the other array must be deleted or moved. Hope this helps or is what you were looking for
The End.
JLopeman