Beginners - March 2017 (Page 9)

by egio
How can I create a node counting function and a 3-parameter constructor for my binary search tree?
 
Hello, I'm trying to see how the following code looks like: 1) If I wanted to make a three-parameter constructor for my BST below, how would it look like? 2) ...
[1 reply] : If I wanted to make a three-parameter constructor for my BST below, h... (by gunnerfunner)
Using structs
 
I am creating a simple address book program. I am having trouble properly implementing the header file. I know I need to change line 8 to cin>>Person.firstname....
[3 replies] Last: For Example struct data { string name; string last_name; // if... (by bird1234)
Accessing private members using Operators
 
my x and y is private so i cant p.x or p.y #include <iostream> using namespace std; class test { private: int x; int y; public: test(); ...
[2 replies] Last: the operator + overload is incorrect - from the return statement it se... (by gunnerfunner)
cannot remove and rename the file
 
OS: Window 10 Compiler : Visual Studio 15 Error : file is not renamed : permission denied void deleteuser() { // header file // #include<iostream> #inclu...
[3 replies] Last: ouh i forgot to put brackets in close now it is working thnx @Chervil ... (by bird1234)
Looping yes or no while storing a value and reusing it.
 
How do i get a program such as below to repeat itself until it terminates if Money is less than the cost of the Laptop? And print out its new remainder for ever...
[no replies]
How to enqueue and dequeue in mult-idimensional array?
 
Its Semester break already I've been practicing what I've learn in data structures subject. I'm trying to make a program that en queue and de queue data structu...
[5 replies] Last: JLBorges what is that? (by spike32)
last name switch
 
hello, Im just trying to do a simple switch of last name using a string function. I can simply put the function in the main and it will come out good, but when...
[5 replies] Last: is there any way to keep the spaces of the new name to one single sp... (by gunnerfunner)
Array c++ sequential search
 
I want to ask I'll make a sequential search with array static A = {13,34,2,1,23,12,45,29,12,11,98,7,4,53}; But when i run that program, it just viewing 13...
[1 reply] : Can you paste the code? You can iterate through whole array with a fo... (by Hengry)
by Ch1156
How do I get the percentage amount in this formula
 
I am trying to create a program that can calculate the same cargo bonus formula for my game i'm making, but i'm having a slight problem with this formula. I sho...
[1 reply] : The percentage sign basically tells you to devide by 100: $500 (for 5... (by coder777)
Missing 0 When Printing Out?
 
I have to write a program that takes two times in HH:MM format and tells the difference between them. I need to print out the times (ie: the difference between ...
[1 reply] : #include <iostream> #include <iomanip> // for std::setw, std::setfill... (by JLBorges)
How to change pointer from vector element to vector. (1,2)
 
I've written a function which gets back a reference to a location in a vector. I want the pointer to point to this entire vector not just the location of the el...
[21 replies] Last: I'm inclined to avoid creating a new hand class at all: a hand is noth... (by mbozzi)
by j rod
Mode
 
Hello. I have written some code to find the mode. However I want it to output every mode. Example Input 2 2 3 3 Output 2 3 Here is what I have done ...
[2 replies] Last: gunnerfunner I am not very adept at c++. I was not sure how to implem... (by j rod)
by logana
C++ Array problem???
 
I tried this Array entry method, where it asks for a colour then you press return and put in the remaining ones, and then it prints out the full Array. Can anyo...
[2 replies] Last: Thank you Chicofeo; that is very neat. Nice code! (by logana)
by Meden
Beginner's cin validation
 
I am wondering if someone could write a very simple example of an entry validation function. I am trying to understand how to do it, but I am working with a cu...
[5 replies] Last: thanks again cire. your suggestion is undoubtedly more elegant and rob... (by gunnerfunner)
Dynamically Allocating for Multi-Dimensional Array
 
I have this piece of code that may or may not be correct (feel free to comment on it, but that's not my current issue), and I'm attempting to call it from anoth...
[1 reply] : Something like this, perhaps? // Run again with Runge-Kutta (vari... (by cire)
by leyla2
collision detection
 
Hello, my program doesn't have any errors but for some reason I am stuck on this collision detection part of it: void Ball::collisions() { if (BallLoc.y...
[10 replies] Last: I come here to learn too. I learned c++ way before the STL existed, a... (by jonnin)
Comparing user input always equals false. Why? (1,2)
 
I can't figure out why when I try to compare the users input answer to the answer in the array it always prints out incorrect, no matter if the answer is wrong ...
[39 replies] Last: Thanks for all the help guys. I got my program completely working as i... (by pleaseINeedHelp)
sum equation
 
I believe my sum calculation is not working and I would like to know what I am doing wrong. please and thank you /* the following program has a class tha...
[1 reply] : line 30: your 'Sum' function is of type void and then does not return ... (by ar2007)
Generating 100 million unique random unsigned integers
 
Hello guys, i am thinking of building a program where i would take up data for people in the millions. I want to create a surrogate key to identify each person....
[16 replies] Last: Thanks guys for putting up such an educative debate. Special thanks to... (by longberns)
Problems with 'while' loop.
 
I have included the code I have started along with the output and output expected. My first month keeps starting with my deposit amount of $100 when it is suppo...
[6 replies] Last: Changed the code to the following and everything is compiling like it ... (by maschneid)
March 2017 Pages: 1... 7891011... 36
  Archived months: [feb2017] [apr2017]

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