Beginners - September 2014 (Page 22)

Error calling function
Hello please explain why my double get_average_score() doesn't return the desired value and instead return inf. number is a count variable. I probably increment...
Sep 20, 2014 at 5:28pm
[4 replies] Last: got it thanks! (by Zenith1900)
Need Help with the code
What is the correct answer and why? int main() { float val = 100.0; do { val = val / 5; cou...
Sep 20, 2014 at 5:22pm
[4 replies] Last: BEcause after you divide val by 5 third time result will be less than ... (by MiiNiPaa)
expected initializer before ': and was not declared in this scope
Hi. My name is Tung. I just began study C++ and encountered some problem with it. I am writing a program that can draw zigzag line. The length of the zigzag is ...
Sep 20, 2014 at 4:42pm
[2 replies] Last: Thanks slouchcouchgamer (20). But my program still pop up this error z... (by tungnguyen123)
errors
why i keep getting an error error: invalid use of non-static data member 'Wasd::height'| #include <iostream> using namespace std; class Wasd { const i...
Sep 20, 2014 at 4:27pm
[3 replies] Last: normal members are copied for each instance of an object: class exa... (by Disch)
Math formula
How can I convert the following into C++? sin 2 x? Thank you.
Sep 20, 2014 at 4:25pm
[6 replies] Last: True, I was thinking about that myself after I posted but didn't bothe... (by Ganado)
code
What is the answer and why? #include <iostream> using namespace std; int fun(int p1=1, int p2=1){ return p2<<p1; } in...
Sep 20, 2014 at 3:07pm
[4 replies] Last: Thanks buddies, great help (by fazalhussainakbar)
Variable type for deciamls
I have to display a number like 2.3284646746 keeping all the digits. Is there a variable type that can hold this number without cutting off most of it? The cod...
Sep 20, 2014 at 1:52pm
[4 replies] Last: Thank you. It worked. (by gabor53)
error 'char_Creator' was not declared in this scope
i keep getting that error all the time i run the following code and im not sure why: #include <windows.h> #include <iostream> using namespace std; ...
Sep 20, 2014 at 11:23am
[1 reply] : put your char_Creator function above your world_Builder function. (or... (by squished18)
by kemkoi
Making string count numbers, blanks and alphabetical characters
Hello, I'm trying to create a program that counts the amount of alphabetical characters, numbers, blanks and total amount of characters in a string a user gets ...
Sep 20, 2014 at 11:15am
[5 replies] Last: Thank you sir, that solved the problem. (by kemkoi)
3D arrays
I am trying to find the minimum and maximum values in a 3D array. But for some reason my code just doesn't work. There are no errors that apear in the compile...
Sep 20, 2014 at 10:48am
[12 replies] Last: Got it. I edited my post above. It works perfectly. Thanks guys for... (by DeathLeap)
by BLANKE
ZigZag Design Help
My program is suppose to look like this: Please enter the maximum field width: 9 Enter the microseconds to pause between asterisks: 50000 * .* ..* ...* ....* ....
Sep 20, 2014 at 10:41am
[2 replies] Last: With the way you are trying to do it, you will need a directional indi... (by squished18)
Switch problem
Hi, (I am one hell of a newbie in C++) The Question is: Write a C++ program that prompt user to enter obtained(0 - 100) marks for five course. Calculate grade...
Sep 20, 2014 at 9:55am
[3 replies] Last: @LB : Thanks for the advice, i used if else if statement. and it work... (by Paragon)
Program 17
Continuing the previous program: Change the program so that it uses doubles instead of ints. Change the program so that it writes out the numbers are almost equ...
Sep 20, 2014 at 9:37am
[7 replies] Last: Nice explanation, I`m trying to understand how Input/Output streams wo... (by pacman169)
Vector of base and derived classes
I asked a similar question to this previously, so apologies in advance, but the example I gave was quite convoluted and my understanding of classes and inherita...
Sep 20, 2014 at 8:55am
[4 replies] Last: Excellent, thanks MiiNiPaa. Using virtual functions was the missing li... (by slouchcouchgamer)
Convert seconds and minutes
Hello, I am quite new to programming and I have a question. I am writing a program where the user writes down their time for a lap they ran, and there were ...
Sep 20, 2014 at 8:35am
[2 replies] Last: After Adding up Seconds and Minutes, You can do it the following way: ... (by Atyab)
Sum of all odd numbers between a inputed range
I wrote a program to find the sum of all odd numbers between two inputed number (as range). It shows the sum 0 for every range. Why? What is the problem? ...
Sep 20, 2014 at 8:33am
[5 replies] Last: Excellent point ... (by closed account 48T7M4Gy)
by kugi
[C++] SDL Errors - Undeclared Functions (Or Not)?
HEllo! I'm still working on ski jumps game. (I made new code). So i write everythink , and when i press run on my IDE (i use Dev c++) it listet 2 errors. Look:...
Sep 20, 2014 at 5:02am
[2 replies] Last: First, I suggest you look at how each SDL function operates at base le... (by roger911)
by wooly
Need some help!
I'm trying to write a script asking people if a test was too hard or not. I'm new, and I'm not very good with the "if" "else" thing yet. This is my code so f...
Sep 20, 2014 at 4:37am
[3 replies] Last: So, forgetting how to write the C++ code what steps would you take to ... (by closed account 48T7M4Gy)
Do loop, check if input is what I want
Here is a easy program which I want the user to choose from number 1 to 5. But if the user input a string, like "a" "dsaf" or something. The program just proces...
Sep 20, 2014 at 4:26am
[2 replies] Last: Hi, I really dislike no hate constructs like on line 10. They are ... (by TheIdeasMan)
wrong result.
In my program i have the following: 84.74 - 84 - 0.74 and it says it equals to -2.14577e-006 , how do i fix this? shouldn't it be 0? i have: int = 84 , double...
Sep 20, 2014 at 3:36am
[8 replies] Last: Well first off, why are you intermixing doubles and floats? It might n... (by Ganado)
September 2014 Pages: 1... 2021222324... 51
  Archived months: [aug2014] [oct2014]

This is an archived page. To post a new message, go to the current page.
Registered users can post in this forum.