Beginners - November 2015 (Page 29)

issue with array in the while loop
Hi I am having difficulty with printing only 20 values in my loop. It should only repeat the loop 20 times but mine is repeating it 21 times. Can someone look o...
Nov 15, 2015 at 11:12am
[1 reply] : Run this simplification and you'll see what is happening to item numbe... (by closed account 48T7M4Gy)
by Rehmat
How to avoid blinking?
Assalam-o-Alaikum! Please help me to avoid Blinking in my program output. I am using Turbo c++ v.3.0 Thanks in advance! #include<iostream.h> #i...
Nov 15, 2015 at 11:03am
[no replies]
Compiler not searching well in the file
#include<iostream.h> #include<stdio.h> #include<conio.h> #include<fstream.h> class x { int rollno; char name ; public: void mod() { cout<<"\nEnter ...
Nov 15, 2015 at 10:33am
[no replies]
by cspace
Constructor and Anonymous Objects
Hi, I have a few yes/no questions about the code line below: Cat acCats = { Cat("Fred"), Cat("Tyson"), Cat("Zeke") }; //Cat is a user defined class with...
Nov 15, 2015 at 7:54am
[6 replies] Last: Thank you for the details and the attached references; it was more tha... (by cspace)
HELP on function assignment
I just learned functions in my class and im having a hard time with my code. it just gives me infinite errors in my error file. I also need help on how to count...
Nov 15, 2015 at 7:17am
[1 reply] : This has nothing to do with functions. hourlyWageError = hourlyWage ... (by admkrk)
Pointers
This is a small segment of my code. I have created two vectors. I am successful in displaying both of them but when I try to subtract one from the other, it giv...
Nov 15, 2015 at 6:26am
[1 reply] : when the loop on lines 1--6 ends, `counter' would be `Numbers.end()' (... (by ne555)
program compiles, but nothing outputed
hi im writing a program to decode a morse code message. my program compiles without any error but nothing happens when i enter my code to be decoded. i think th...
Nov 15, 2015 at 4:11am
[no replies]
How do I print out a vector from a class?
I have a class named Pizza that asks all the information and displays it properly and I have to make a class named Order that has a private vector that basicall...
Nov 15, 2015 at 3:56am
[2 replies] Last: That worked perfectly. Thanks! (by mk92595)
need help with battle system
im working on a little text battle game. what i have so far seems to be ok. im just learning so please be gentle if criticizing me. what im having trouble wi...
Nov 15, 2015 at 2:09am
[8 replies] Last: thank you so much!!!! (by tinymikey)
Need help with void recursive problem, 1,2,3,..n
Hi, I was really struggling with the following problem for an assignment. I really confused on how exactly I should use the void recursive function for it. I ha...
Nov 15, 2015 at 1:46am
[11 replies] Last: Your explanation seems pretty good. When the calls are returning, as t... (by closed account D80DSL3A)
by ottob
Classes
I am creating a program, these are the requirements: We are going to write a program to figure out if several elements are boiling or melting. Substance---M...
Nov 15, 2015 at 12:56am
[1 reply] : line 31,36: where is t defined? Did you mean temp? Which temp? The... (by AbstractionAnon)
Passing multiple variable types to a function
I'm writing a little game, and to save the game data I would like to take the variables that I have in main and send them to a save game function in a class. ...
Nov 15, 2015 at 12:24am
[3 replies] Last: I will add to what was already said. Make a class that maintains your... (by Duthomhas)
stock broker program
updateSharePrice() to randomly determine whether the stock price went up or down and by what percentage (1-5%). It should return the updated value. and A...
Nov 14, 2015 at 11:49pm
[2 replies] Last: I am not sure how to keep track of the values that the share price is ... (by aimrod32591)
Panel Class
Outdoor Advertising Panels” have the following characteristics: length–A Constantnumeric value indicating the lengthof the panel in meters.(Defaults to 5 )...
Nov 14, 2015 at 10:50pm
[8 replies] Last: first the string getLocation how do we write the function ?? and can... (by Thomas1965)
by Dazzer
Derived & base class question
Hi folks, I wrote the following bit of code. Although it compiles, i'm not quite understanding what actually happens when i execute: Base MyBase = MyDerived; ...
Nov 14, 2015 at 9:47pm
[2 replies] Last: Thanks for taking the time to reply, i think i inderstand it a little ... (by Dazzer)
Reading data from a file.
Hello, so I am trying to read data from a file, each line has 7 pieces of information i need to store in different variables. Im not sure how to separate pieces...
Nov 14, 2015 at 9:15pm
[1 reply] : I'd recommend using getline() to retrieve an entire line from the file... (by jlb)
Game of Life implementation help
So I am having trouble getting the game of life to run. Our instructor gave us the first code, the second code is what we were supposed to right which is an i...
Nov 14, 2015 at 8:28pm
[no replies]
How to overload stream operator without using friend function?
I'm studing about operator overloading. I've written a simple program to show operator overloading by using friend function. How can I write this without friend...
Nov 14, 2015 at 8:12pm
[3 replies] Last: Why are you using C-strings instead of std::strings? Do you realize ... (by jlb)
by mhurt
Roulette Program Problem
Hello everyone, trying to generate a game of roulette. But I think Im going about it the wrong way. It produces a funky output and Im not sure what Im doing wro...
Nov 14, 2015 at 7:54pm
[4 replies] Last: I agree with you on the formatting. I can see where larger code would ... (by mhurt)
by ottob
Classes
Substance Melting Point Boiling Point Zinc (Zn) 787.15°F 1665°F Barium (Ba) 134...
Nov 14, 2015 at 7:01pm
[no replies]
November 2015 Pages: 1... 2728293031... 53
  Archived months: [oct2015] [dec2015]

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