Beginners - November 2013 (Page 18)

problems with arrays
 
I'm trying to write this code that takes in data from a txt file. I have to use parallel arrays to store the name of the voters the number of votes they receive...
[1 reply] : Well, line 17 won't work: double percentage = {votes / total}; ... (by Chervil)
Encapsulation involving multiple classes
 
Hi all, I'm having trouble with encapsulating my C++ code. So far, I've created 7 files: person.h, person.cpp, city.h, city.cpp, country.h, country.cpp and a...
[8 replies] Last: Thank you ShodanHo! I found your reply very helpful. Also, thank you n... (by Macalay7777)
Drawing a car image using string?
 
So, I have a code here that prints out the image of a car. I don't know what I have done incorrectly in my const string carimage. The output I get in this funct...
[no replies]
thread stopped suddenly
 
there is no error when i compiled this code, but when i run it. it will automatically stop and show the CPU memory address. can someone figure out what the prob...
[1 reply] : why anyone don't want to help me? T_T (by orangebanana)
Global Constants and External Arrays
 
Hello everyone. I'm having trouble building my dice application ( github.com/lmwunder/Fishy-Dice ). I want to be able to use a bunch of global constants that...
[3 replies] Last: So all constants have internal linkage in C++ throughout the entire pr... (by closed account 49iURXSz)
by dp13
Trouble with passing arrays of structures to functions
 
I do not understand where I'm going wrong in syntax here. I am trying to use an array of structures, but it will only compile when I use a structure variabl...
[6 replies] Last: ... (by dp13)
Union find random maze
 
I have been at this for a little too long and cant see what math I am getting wrong to make this random maze. Right now it is just getting rid of walls in a dia...
[no replies]
help not sure what error meassage means.
 
I'm in a computer programming class and having trouble. The assignment is: Write a program that uses a structure named MovieData to store the following infor...
[2 replies] Last: Oh snap! Didn't notice Thanks for the help. ~ EBC (by Erotic Buddhist Champion)
by Xesna
Comprehend or Die trying in C++
 
IMO, C++ isn't a beginner language. If you are just starting to learn programming to implement algorithms, language constructs should not be the main focus. It...
[10 replies] Last: Thanks for the boost of confidence and information guys. (by Xesna)
by Xesna
Lowest Score Drop
 
Can anyone explain how a 81.25 = ((100 + 90 + 50 + 20 + 65) - 20)/4.0, when the average should be 76.25? I got the code to work except during the calculati...
[2 replies] Last: Thanks. (by Xesna)
Weather statistics using structure
 
I have been working on this for awhile, but I was hoping to get input from someone with more experience. I have to stick with the structure and enum format for...
[1 reply] : I dont quite get it, and it looks like you too are undecided: What Wea... (by JockX)
Writing a mad lib program, need some help
 
I'm working on a project for my intro c++ class in which we are printing out a mad lib. I am pretty close to finishing it up, but I'm dealing with a couple maj...
[1 reply] : Since madLibStory is not std::string, but an array, it cannot be eq... (by JockX)
Dealing with strings in a template function
 
Hello, In my programming class we have just started looking at template functions and I have been given a simple exercise to do to start off with. I have most ...
[3 replies] Last: Hi again, Played around with class template specialization and this w... (by maximus123)
im terrible at loops
 
I wrote this basic calculator program for school, and id like to loop it. its not required but i figure why not. I attempted a for look but its not working and...
[6 replies] Last: well like i was saying for this assignment im not required to loop it ... (by iamlearning)
stack overflow?
 
Getting warnings for my operator+=, -=, /=, *= ...what am I doing wrong?? DollarsCents& DollarsCents::operator+= (const DollarsCents& money) { DollarsC...
[9 replies] Last: Okk, I see I got it to compile but I'm getting some weirdness with my... (by halamaker)
need help starting this array
 
write a program that lets the user enter the total rainfall for each of 12 months into an array that doubles. the program should calculate and display the total...
[no replies]
Trying to ask user for a file name to input
 
I would like to ask the user for a file name to input, cin that file name, and then load it into the ifstream. For example... string inputFile; cout <<...
[2 replies] Last: Worked perfect. Thank you! (by blackvelvet77)
by Garion
Passing file name to ifstream myfile
 
I'm slowly plugging away at my music program. I would like to be able to pass a file name similar to this program below. I'm trying to keep a text parsing prog...
[4 replies] Last: Thank you both. combining your two suggestions fixed my problem :) (by Garion)
Sharing Class information
 
I have one base class and two derived classes, I have values in the derived class that I need for calculations in my base class. How do I call it to that loc...
[2 replies] Last: I did that and I thought I was doing it wrong because the display does... (by stardust2552)
by eran
sum function
 
Write a function that accepts an integer value (non-negative) and returns the sum of the digits of the number exmple: 1023= 1+0+2+3=6 i dont have idea how i...
[4 replies] Last: take remainder in each iteration and save it in variable say remsum. n... (by dukhi x)
November 2013 Pages: 1... 1617181920... 80
  Archived months: [oct2013] [dec2013]

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