Forum: C++ Mar 8th, 2009 |
| Replies: 4 Views: 1,424 Big thanks to all three of you. Got it working. |
Forum: C++ Mar 5th, 2009 |
| Replies: 4 Views: 1,424 Quick question (hopefully). I have a vector of strings and need to remove duplicates. Normally, I'd just use sort, erase and unique. However, I don't want to sort the data. My idea was to copy the... |
Forum: C++ Jan 15th, 2009 |
| Replies: 1 Views: 251 So I'm working on a C++ program and part of it involves converting decimal numbers to hexadecimal. I have been using printf("%02X",number) to do this, but I'd like to print to a text file. Just... |
Forum: C++ Apr 15th, 2008 |
| Replies: 5 Views: 1,899 Program is supposed to be an database that responds to SQL-type commands. So the first choice is what you'd like to see (Flight numbers for example) from an airline(again for example). So choosing... |
Forum: C++ Apr 15th, 2008 |
| Replies: 5 Views: 1,899 passing like this:
searchString (sTemp, 5, answer)
And the array contains the following: |
Forum: C++ Apr 15th, 2008 |
| Replies: 5 Views: 1,899 I have a funny feeling this is a stupid question so bear with me. I'm passing a string array to a function to search for elements in it. I have what is written below, and all it does is print "Not... |
Forum: C++ Mar 26th, 2008 |
| Replies: 2 Views: 961 Okay I got it. Just needed to move the cout statements to the front of the function and use a static int. Which I had never used before (thanks vmanes). Tried something similar before but just kept... |
Forum: C++ Mar 26th, 2008 |
| Replies: 2 Views: 961 I'm having a tough time conceptualizing this problem. I have a recursive function computing the number of possible combinations of two numbers. I have it working fine, just need one thing sorted out.... |
Forum: C++ Mar 14th, 2008 |
| Replies: 7 Views: 705 Got it.
Needed to move the function below both class declarations in order to get the compiler to recognize Grade. operator== function is working as well. Thanks again Ancient Dragon. Here's the... |
Forum: C++ Mar 13th, 2008 |
| Replies: 7 Views: 705 Sorry AD. In another thread you added line numbers to my code so I tried to add them, but used the wrong button.
#include<iostream>
using namespace std;
const int MAX_GRADES = 4;
class... |
Forum: C++ Mar 13th, 2008 |
| Replies: 7 Views: 705 I followed most of Ancient Dragon's suggestions (leaving operator for later) but still getting the error that Grade is an undeclared identifier. Tried making it a public but that did nothing (kind... |
Forum: C++ Mar 12th, 2008 |
| Replies: 7 Views: 705 Having some trouble with converting my driver input from one class to the friend class and then summing the array. My setGrade function is reading the input correctly (I think, the numbers match up)... |
Forum: C++ Feb 7th, 2008 |
| Replies: 6 Views: 919 Made some changes with VernonDozier's recommendations (thanks for all the information) but still getting a logic error with setRaceCarStatus My specs have it as taking a boolean parameter and... |
Forum: C++ Feb 6th, 2008 |
| Replies: 6 Views: 919 So RaceCarStatus is no longer a function, and along with a couple minor changes it compiles. However I'm getting the same result for RaceCarStatus before and after input. Part of the spec is having... |
Forum: C++ Feb 6th, 2008 |
| Replies: 6 Views: 919 My professor gave us a set of class specifications for three classes. Vehicle, Car, and Truck. My vehicle class works fine, and utilizing it in the other classes is fine as well but I'm having... |
Forum: C++ Dec 11th, 2007 |
| Replies: 4 Views: 955 I got the write to file function working. Just need to finish up the delete function. In case anyone was paying attention.
Card card[100];
string newFile;
int num = 0;
int counter = 0;
... |
Forum: C++ Dec 10th, 2007 |
| Replies: 4 Views: 955 That would just print them all on one line. Like this:
lastfirstphoneemaillastfirstphoneemaillastfirstphoneemail...
But thanks for the tip. I should have noticed that earlier. |
Forum: C++ Dec 10th, 2007 |
| Replies: 4 Views: 955 So below is a working program I wrote that mimics a rolodex. It stores the information on a text file with the number of cards listed at the top of the file and one card per line like this:
... |
Forum: C++ Nov 23rd, 2007 |
| Replies: 14 Views: 4,073 It works. Thank you guys so much. I thought I was just digging a hole for a while there. I still need to loop the main until 0 is input but I'm sure I can handle that. Thank you again. |
Forum: C++ Nov 23rd, 2007 |
| Replies: 14 Views: 4,073 I tried debugging with the visual studio 2005 debugger and it was reading junk values (-50 for every one). I tried changing the parameter to what you suggested but it couldn't compile since the... |
Forum: C++ Nov 23rd, 2007 |
| Replies: 14 Views: 4,073 My output being in the right format means it looks like this after running it:
Enter a roman expression
X + X
=
Enter a roman expression.
Post #3 has the old output.
I had changed all of... |
Forum: C++ Nov 23rd, 2007 |
| Replies: 14 Views: 4,073 I changed this:
int convertToDecimal(string&)
{
char roman[20];
int length = strlen(roman);
My output is in the correct format but there's no answer. |
Forum: C++ Nov 22nd, 2007 |
| Replies: 14 Views: 4,073 I'm not sure I understand this part. I pass the value as a string to convertToDecimal and need to return an integer but can't redefine things. I used the length member function to read from the... |
Forum: C++ Nov 22nd, 2007 |
| Replies: 14 Views: 4,073 Per the assignment we don't have to account for subtraction values. So IV and VI = 6.
And my example was bad and confusing, sorry. I input three capital X's (not a multiplication lower x) but it... |
Forum: C++ Nov 22nd, 2007 |
| Replies: 14 Views: 4,073 First off, happy thanksgiving everybody. Second, my program has problems. I've discovered a horrible way (for me anyway) to design and my attempts to fix it aren't getting any where. I have to design... |
Forum: C++ Oct 5th, 2007 |
| Replies: 5 Views: 2,765 Fixed it I think. Added the following statements:
else if (answer == 'c')
{
cout << "Got it " << firstName << endl;
numGuesses = NUMBER_OF_GUESSES +1;
}
else
{ |
Forum: C++ Oct 5th, 2007 |
| Replies: 5 Views: 2,765 That's a good question. I wanted to get the math figured out first, then tackle the exit. Probably by adding 'c' as an option in the high/low question, and then another else if statement. But that... |
Forum: C++ Oct 5th, 2007 |
| Replies: 5 Views: 2,765 Did all of that and had the same problem. However, changed line 45 to max = computerGuess and that did the trick. With those changes it left me with max as an undeclared variable. So I set the... |
Forum: C++ Oct 4th, 2007 |
| Replies: 5 Views: 2,765 Having some trouble with my number guessing game. The object is that the user thinks of a number between 1 and 100 and the computer tries to guess it in a set number of tries. The user inputs an... |
Forum: C++ Mar 29th, 2007 |
| Replies: 9 Views: 2,345 I'll work on it. Thanks for the pointers WaltP. I got bracket-shy because the missplaced bracket in the OP was silly and time-consuming. But you are right. Thanks again. |
Forum: C++ Mar 29th, 2007 |
| Replies: 9 Views: 2,345 Here's the whole thing. I'm submitting it today so if there's any fine tuning that needs to be done or if you'd just like to yell at me feel free. WaltP- I tried spacing stuff out and lining things... |
Forum: C++ Mar 29th, 2007 |
| Replies: 9 Views: 2,345 I'm reformatting right now. I agree that it is hard to read and apologize. I'll repost as soon as I'm done. Thanks for telling me. I'm sure that would have cost me points. |
Forum: C++ Mar 29th, 2007 |
| Replies: 9 Views: 2,345 Sure I'll take a look. I'd like to see another way of doing it. Thanks. |
Forum: C++ Mar 28th, 2007 |
| Replies: 9 Views: 2,345 Thanks a lot. It's reading the file just fine now but I noticed another problem after running through a couple generations. I neglected to include a command to populate a cell with three neighbors.... |
Forum: C++ Mar 28th, 2007 |
| Replies: 9 Views: 2,345 Just registered but you guys have been a big help for the whole semester. I have what seems to be a simple problem but I'm just stuck. My assignment is a game of life sim that prompts the user for... |