1,362 Posted Topics

Member Avatar for HoldenCfld

How are the integers songMin and songMax going to hold the titles of the respective first and last titles? Your branching code should be done as a series of if...else if statements - when any one of the three (not four) possible conditions is met, there's no point in continuing …

Member Avatar for HoldenCfld
0
100
Member Avatar for penty

Imagine you have a stack of papers in front of you, each with a number written on it. They are in no particular order. You can only pick up one sheet at a time, the one on top. How would you find the largest and smallest of the numbers in …

Member Avatar for vmanes
0
82
Member Avatar for Robin_Dragon

This sounds like a homework assignment I once gave. Or maybe will give soon. Please make your best attempt at solving this problem, then post your code if you find you have difficulties.

Member Avatar for Narue
0
2K
Member Avatar for anga08628

Passing the strings to a function is no different than passing arrays of any other type. They are, after all, just arrays. So a function prototype for you might be something like [code] void make_user_id( char name[], char id[], char user_id[] ) [/code] Note also that your code to read …

Member Avatar for Ancient Dragon
0
167
Member Avatar for DemonSpeeding

To compare your strings, ignoring any case difference, you should first of all change the strings to all upper case or all lower case after reading them in, such as: [code] transform(names[count]begin(), names[count].end(),names[count].begin(), toupper); [/code] Use tolower as the last parameter if you want lower case. Do this to the …

Member Avatar for vmanes
0
114
Member Avatar for robotnixon

AD is right that lines 36 and 46 don't belong. Additionally, min and max should both be initialized to their respective values when you declare them in lines 13 and 14. How does the game end if the computer actually guesses the number? I would caution you about reusing this …

Member Avatar for robotnixon
0
110
Member Avatar for cs1

To keep getting responses until a correct answer is given, [code] cin >> multi; while ( multi != number1 * number2) { cout <<"That's not it, try again'" << endl; cout << "how much is " << number1 << " times " << number2 << "?"; cin >> multi; } …

Member Avatar for vmanes
0
112
Member Avatar for gator6688
Member Avatar for mstrmnd2008

In line 11 do you mean to be creating a value for number of seconds in a minute, like your sph value for hours? Then you ought to have something like: mph = 60; And not use the <= that you wrote, which makes a statement that does nothing useful. …

Member Avatar for vmanes
0
115
Member Avatar for kako13

You are testing the eof before having read anything. What happens if your file is empty (0 length)? To properly use the eof() method, you must read something before the loop test, then read that element as the last action in your loop body, similar to: getline( myfile, identifier); while( …

Member Avatar for Narue
0
1K
Member Avatar for GirlInterrupted

I would suggest that Google is your friend. Search for c++ tutorials and you'll find many. Only you can tell if one is suitable to your needs. Beware of any that still use the older standards for C++ - you'll spot these when they use header files such as <iostream.h> …

Member Avatar for Duki
0
89
Member Avatar for eranga262154

If filedata is to be opened and closed in the dataExtract() function, it need not be a global, declare inside the function. As mentioned, use the appropriate file mode to set the writing action to occur at end of existing content (I'd use ios::app ). Alternatively, you could open the …

Member Avatar for eranga262154
0
154

The End.