Beginners - January 2015 (Page 5)

why function isnt returning double
Explanation on why the weight is returning back as an integer and not double? thanks. /*Write a program that models a virtual pet. We will assume the pet wi...
Jan 29, 2015 at 4:08am
[1 reply] : In your feed pet function try changing weight = (double(weight + 0.2... (by closed account 2UD8vCM9)
Can't get rid of leading zero
I'm doing assignment for my compsci beginners class. I keep getting a leading zero before you enter a value and I can't seem to get rid of it. #include...
Jan 29, 2015 at 4:05am
[2 replies] Last: Thank you so much!!! (by calisabeth)
Errors with triangle coding
I need help with the errors when I run my compiler I still have about 5 errors and one caution ! expected '}' lines 27-3 times and line 58-4 times triangle...
Jan 29, 2015 at 3:46am
[1 reply] : 1.) Use the code tags. 2.) Make sure you are closing your brackets. ... (by Militie)
How program can ask me to put value?
I have to code this program Write a user friendly C++ program to: 1) Declare, read in and print out your name as a string. 2) Calculate power from voltage and...
Jan 29, 2015 at 1:06am
[3 replies] Last: Okay! I got it. Thank you! :) (by nomanrasheed)
Dual Sorting Ascending Order
Hello, How do I change this function from sorting in descending to ascending order? Can't seem to figure it out. I have been changing the signs around and still...
Jan 29, 2015 at 12:58am
[no replies]
by tr1944
Enclosing classes in namespaces
I am trying to figure out how to include a class in a namespace, but I can't even get it to compile. Here is a toy class inside of a toy namespace, x. Compi...
Jan 29, 2015 at 12:51am
[1 reply] : base1.h namespace x{ class base1 { public: base1(int... (by ne555)
Issue using the pop command for a Queue
I'm getting an error message flag up in the code that I'm writing, the error message states "Cannot initialise a variable of type 'char' with an rvalue of type ...
Jan 28, 2015 at 11:41pm
[2 replies] Last: Thanks for the help, I've been really struggling with Queue functions,... (by JoshObyrne92)
by gmac
std dev.
Need a little help. computes the standard deviation1 of a list of numbers in a file. The program is to be called comp201 stddev and will take one command li...
Jan 28, 2015 at 10:29pm
[12 replies] Last: You say "similar". The devil is in the details, so show your exact cod... (by keskiverto)
Searching for words in file without using arrays
I was posed with a problem where I am not allowed to use arrays to check for certain words in a file. I'm very new to C++ but not to programming. This idea se...
Jan 28, 2015 at 10:10pm
[1 reply] : There are many data structures you can use to store information. You... (by Militie)
trajectory of circles moving
Hello, I'm new to c++ and I made a program of one circle rolling another one. Now, I don't know how to make the trajectory of the smaller one depending on its r...
Jan 28, 2015 at 8:50pm
[no replies]
Having Trouble With Program Organization/Structure
Hey guys! I am fairly new at C++, and seeing as I have followed several tutorials with basic syntax, structure, etc, I figured I would start up a small project ...
Jan 28, 2015 at 8:10pm
[6 replies] Last: Consider using set<> instead of a hash table because all you have to... (by dhayden)
count the occurrence of letters in the string
this code is printing strange numbers instead of the number of characters in the input string #include<iostream> #include<string> #include<cctype> ...
Jan 28, 2015 at 7:53pm
[4 replies] Last: Thanks cire! i was able to figure this out (by Asim1589)
retrieving multiple elements from a vector in one pass
I want to be able to sort a class based on the size of a vector that lives inside. I want for the algorithm to return me 5 elements with the highest vector stri...
Jan 28, 2015 at 7:46pm
[6 replies] Last: Read the link I provided before. It is an iterator to element you want... (by MiiNiPaa)
by HelenI
Stacks,String,For.....
Hey, i'm little confused. Somewhere in this code there is a problem i think so. I believe that the problem is in the for which push p in the stack.I need help! ...
Jan 28, 2015 at 7:18pm
[6 replies] Last: Now it works!!! Thank you very much!!! :) (by HelenI)
Number Guessing Game
Write your question here. I just hit a wall on this again, I really need specific instructions on how to make this work please. I am trying to get it to allow ...
Jan 28, 2015 at 7:07pm
[4 replies] Last: 1. If you want to insert a comment in code do it like so: std::cout <... (by TheHardew)
file i/o
so let say i got some numbers like so in a .txt file 12 13 22 22 43 45 23 54 87 89 98 88 34 55 76 88 8 88 45 32 45 28 98 88 i want to write a cod...
Jan 28, 2015 at 6:59pm
[2 replies] Last: I wrote a sample of the code: #include <iostream> #include <fstream... (by PopEye)
No Operator "==" matches these operands.
Hello, I'm trying to play around with some code to better learn how to do another program I'm trying to write, experimenting with input files and such, but I ca...
Jan 28, 2015 at 6:16pm
[3 replies] Last: Note on lines 32-38: The operator>> returns reference to the stream. T... (by keskiverto)
factorial function help :)
Hey all, I'm trying to write a factorial function in c++, but I seem to be having some problems. When i pass in the value 5 to my factorial function, i get the ...
Jan 28, 2015 at 6:08pm
[no replies]
Parameters
Hi guys, I'm fairly new with c++ and I have been trying to make a pound to euro conversion program with only local variables and parameters, I think I'm fairly ...
Jan 28, 2015 at 5:59pm
[4 replies] Last: I got it to work! also, good point, I'll remember that in future, chee... (by Arichimoto)
by AVM8
deque
Use a for loop with a counter starting from 0 to store even numbers into a deque sequence container. The list of numbers should look like this: 20 18 16 14 12 ...
Jan 28, 2015 at 5:39pm
[6 replies] Last: MikeyBoy I found the error where i done silly mistake where i wish ... (by AVM8)
January 2015 Pages: 1... 34567... 39
  Archived months: [dec2014] [feb2015]

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