Beginners - September 2014 (Page 18)

Help with correcting formula
 
I am unsure what is wrong with my code, the formula i need to have is x*(1+(r/100))^Y where x is initial investment and r is interest rate and y is years #i...
[1 reply] : You are declaring intRate as an integer data type, but the line intRat... (by hyperfine)
Problems with understanding a c++ code
 
Please help me understand the following c++ code. The following are different parts of the code that I have questions with. The complete code has 191 lines, I a...
[no replies]
by emlynw
How to put program into functions
 
I'm trying to learn to program and have made a program for my physics work, is there a way to make this program better by putting it into functions? such as hav...
[3 replies] Last: Use functions when your code has one or more independent parts. So one... (by shadowCODE)
Copy Constructor
 
What is wrong with my copy constructor? If I change the string datatypes to int it works...IDK.. update: okay so the string never allocated memory on the hea...
[2 replies] Last: thanks i didn't write a destructor cause it was just a 2 second thing ... (by novellof)
by Kernul
Searching for exercises
 
I'd like to practice in C++ with exercises that start from the basics (like condition, iteration, variables, etc) with a difficult that gradualy increase every ...
[3 replies] Last: Your welcome Kernul, glad it helped. (by Codermik)
if-else condition problem using in a loop
 
I've written a solution for the UVa problem NO#12250. My logic is ok I think but the loop terminates in first input. Here is the code.. #include <iostre...
[6 replies] Last: Your welcome :) (by Codermik)
Correct call?
 
How to correctly call function add_quiz so it would do the couts? #include <iostream> #include <iomanip> #include <string> using namespace std; class ...
[1 reply] : See http://www.cplusplus.com/doc/tutorial/classes/ (by keskiverto)
by vxk
Pointer problems
 
I am confused with pointers and have a few questions regarding the following code : int x; cin>>x; int* pointer2 = new int ; delete pointer2...
[18 replies] Last: I am not familiar with Xcode, but there should be something to control... (by MiiNiPaa)
Improve tic-tac-toe game
 
My following code plays a tic tac toe game vs computer, where the computer is making random moves. I am trying to modify the application so that I can choose...
[4 replies] Last: This is my updated code with the solution for who goes first computer,... (by Victor89)
Pseudo code to C code
 
Is anyone good at pseudo-code? I don't really get how to write this into C code. I did the first half and the last thought but i dont quite get the conditions i...
[2 replies] Last: Thanks a bunch! I think i can translate it into C++ I get the idea now... (by vampirenelf)
i know the code but still confuse that how it works?
 
i know the code but still confuse that how it works? Can any body explain how this code works,,, cuz the "*" is not mentioned in any integer so how integers wor...
[2 replies] Last: The outer loop runs once then -> inner for loop is going to run 1 time... (by novellof)
Strings and memory management paranoia
 
Hello, I spent a while getting frustrated with the malloc() and free() baggage that comes with dealing in C strings, so I want a pure C++ approach to strings...
[5 replies] Last: [quote=STxAxTIC]From what I'm reading, I gather that I can avoid the m... (by MiiNiPaa)
by Arnau
Help with word comparison
 
How can i write a program comparing the length of two words, and then say if the first word is greater, equal or lesser than the second ? thanks.
[2 replies] Last: thank you very much!! (by Arnau)
Call to non-static member function...
 
I have spent a few hours working on this and am finally down to three errors "call to non-static member function without an object argument. The errors are in ...
[3 replies] Last: You have no default constructor for that class defined. And it still w... (by Zhuge)
by Jhub
change a character into a number
 
Hello everyone I am trying to write a code that will take a word the user enters and change certain characters into numbers for example if the user enters a wor...
[8 replies] Last: @MiiNiPaa i++ or ++i is not worth arguing about. After all it's ++C we... (by closed account 48T7M4Gy)
Choose one if-statement
 
What I want the program to do is to only choose one of the three if/else statement. If the user inputs A, I want the program to pick the if/else statement th...
[7 replies] Last: @ awkward - sorry, didn't realise, anyway Smac89's post will solve it... (by Codermik)
Largest Sum of Four Adjacent Numbers (2D Array)
 
Hey guys, I have been assigned to write a function (or functions) which displays four adjacent numbers within an array which add up to the largest sum in the ar...
[4 replies] Last: "adjacent"? Do you mean "four in a row, four in a column, or four alo... (by keskiverto)
Find square root of given floating point number
 
Hi. I'm obviously new to C++. I thank you in advance for your help. I know this is a very simple program but I can't figure out what I'm doing wrong. A user...
[15 replies] Last: oh yeah...I forgot to paste those. haha. It took a bit but it finall... (by WishonTD)
by sidei
need help about c++ add two different size arrays
 
I cant get the output that i want,please help me. i want the program can show the number it choose.and the array size must be different.(my fd said that the arr...
[4 replies] Last: Is this a: Select x from set A and y from set B so that x+y==sum. P... (by keskiverto)
by Jhub
Find a letter in a given word
 
Hello everyone, I need to Write a program that takes a single word string from the user. After acquiring this input from the user, the program will use a loop ...
[9 replies] Last: if I am reading this correctly variant 1 and 2 are two different ways ... (by Jhub)
September 2014 Pages: 1... 1617181920... 51
  Archived months: [aug2014] [oct2014]

This is an archived page. To post a new message, go to the current page.