Beginners - November 2016 (Page 29)

bills and coins program
 
Hey guys, im making a program that takes a number and tells you how much bills and coins you have in 500 - 100 - 50 - 20 - 10 - 5 - 2 - 1. For some reason......
[1 reply] : You may be getting 0's from integer division. But I think the formula... (by wildblue)
Copying a vector to a string array
 
I am working on a homework problem and am stuck on something. My program is supposed to take an expression such as the one that follows: 5 + 3 * 2 + 4 / 1 +...
[2 replies] Last: I was going to put the vector output in a string and then have the eva... (by hornet7288)
how do i display x and y
 
I have TXT file that's supposed to be open and read. Line3D, [7, 12, 3], [-9, 13, 68] Point3D, [1, 3, 8] Line2D, [5, 7], [3, 8] Point2D, [3, 2] I am unable to ...
[2 replies] Last: As mentioned previously, Line2D is not a type of Point2D, it should no... (by Chervil)
for_each
 
With for_each function in algorithm header I can manipulate each element of a vector increase 3 by the following script: #include <iostream> #include <...
[5 replies] Last: I would use a function object( functor). ... over a lambda? Really... (by Thomas1965)
Creating array of strings from txt file with pointers
 
I am trying to create a program that reads a text file into an array of strings. I do have to use pointers since the size of the array is determined first by re...
[2 replies] Last: I've made the changes you said and am still getting similar errors. ... (by parkhill)
Putting Numbers from a File into an Array
 
I am currently trying to place the numbers in the file into the array. I keep getting the following error "invalid operands of types 'char ' and 'int' to binar...
[1 reply] : "its not working" is not a helpful description of the problem. What i... (by MikeyBoy)
Need Help with Generating a Username
 
Hey guys - so I'm writing up a program that will take your first name & last name then from that it should generate a username - I already know how to receive t...
[1 reply] : Concatenate the first and second name and concatenate a random string ... (by closed account 48T7M4Gy)
Invalid Return Type
 
I'm trying to get this to save as a float but each time I attempt it's saving data type int to both the temp array and the text file and just creating what look...
[2 replies] Last: You are a genius, thank you sir (or madam)! Now to see what functions ... (by umbranival)
by userco
Character Converter
 
The uppercase member function convert all lowercase letters converted to uppercase. If a character is already uppercase, or is not a letter, it should be left a...
[1 reply] : Either you declare the functions (line 3/4) inside the class and im... (by coder777)
by Gouki
Convert if else to switch case in this example
 
Hi In this code I have tried to substitute the if else statement between line 80 and 107 which I commented out, for a switch case statement. It is however not...
[3 replies] Last: OK I get why its not working. Great, thanks for the help guys! (by Gouki)
Array Multiplication Using For Loop
 
Hey everyone, I am wondering how to multiply the values of an array together using a for loop. For example: int array = {2, 3, 4, 5, 6}; How can ...
[8 replies] Last: The basic idea would be the same, but like integralfx said, change the... (by Tyler T)
cin without pausing the rest of the code
 
Is there a way to continue the code while it waits for an input so if they type while the code is executing it will still work If you look here cout << "I ...
[9 replies] Last: So what from that would i take to get what i want to do? i still haven... (by ExSanity)
by nile12
Why is sqrt working without cmath?
 
Why does this programn work without cmath? The code works fine. I was playing around and thought cmath was necessary. However, the code works the same without i...
[3 replies] Last: Okay thank you JLBorges. That makes perfect sense. edge6768 Windows.h ... (by nile12)
how to get program to read from input file?
 
I am so lost on this one, i dont know how to do this at all.. -- program will read in a list of random numbers from an input file, random.txt d calculate...
[2 replies] Last: I am so lost on this one, i dont know how to do this at all.. -- prog... (by starFish2)
Multiarray reading each column and determine average
 
Hey Guys, How can I determine the average from each individual column? /* Declare and initialize variables */ char month = {"\nJanuary","\nFebru...
[no replies]
Operator Precedence
 
I got a problem that says that if the User enters 2,5,4.3, and 6 the output display for value 1 is 6, value 2 is 27, value 3 is 20.49, and value 4 is 38. I just...
[2 replies] Last: Could you please clarify your question? It's a bit ambiguous. Enter ... (by integralfx)
Creating a binary tree NOT BST
 
I have to create a binary tree with n nodes. I have to take input from a user line by line. Each line has three number. The first number is the value of the nod...
[12 replies] Last: Yea I see what you're saying. I got it to work too! Thank you so much.... (by protater)
Call by reference (original value)
 
Is there a way to know what value n had for the first time? I am unable to finish my code because I cannot give n the value it had at the beginning of the progr...
[4 replies] Last: I cannot see how this int orig = n; would make my code work. In each... (by Oriol Serrabassa)
by roots
Not sure what these functions are supposed to do.
 
I am not entirely sure what im supposed to make this program do. I do know that on the main cpp file, it compares to inputs of feet and inches Enter feet: 4 E...
[4 replies] Last: Thanks, this one wasn't obvious to me. That does seem like the only th... (by roots)
Segmentation Fault Error?
 
asdasdsada
[3 replies] Last: I'm not sure that pqueue.h does anything relevant at the moment - I re... (by lastchance)
November 2016 Pages: 1... 2728293031... 44
  Archived months: [oct2016] [dec2016]

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