Beginners - February 2012 (Page 31)

by PL285
Return Question??
 
Here is the code I have for get_avg(), obviously it does not return both avg_temp_hi and avg_temp_lo. How can I do this? Is there an easier way than making a st...
[14 replies] Last: Change float get_avg(); to avgTemps get_avg(); . :)... (by Berzeger)
Integer won't hold decimels
 
I'm just starting out with C++, and I'm experimenting with different functions and uses. And this particular program is supposed to calculate how much gas you s...
[1 reply] : And how exactly is that surprising? http://en.wikipedia.org/wiki/Integ... (by Athar)
by mr me
Square roots with precision
 
Hello all! This is my first time using C++ and I have the homework assignment as follows, with an attempt below it. **You are to write a program which wi...
[3 replies] Last: #include <iostream> #include <iomanip> using namespace std; double sq... (by histrungalot)
Finding remainder, sometimes returns negative
 
My function often works, but sometimes it displays a negative number when I try to print the remainder. Here is the function being defined: double rem...
[4 replies] Last: Strange, isn't it? (by Cloudboy)
Handling rounding errors
 
and advise on how to go about it? I tried to get help at our computer lab but the guy working was too busy playing solitaire to really help with anything.......
[2 replies] Last: cause I have to deal with tax percentages and my instructor wants 2 di... (by closed account 2EURX9L8)
by dk3919
Leap Year/ finding if a date is valid or not.
 
Basically what I'm trying to do for now is determine if the user inputted date is valid or not only based on the months and see if it is a leap year or not. Fo...
[3 replies] Last: Nevermind got it, it was cause in line 34 I accidentally had it as "el... (by dk3919)
Login UI
 
Im making a program and id like to make a login screen but im curious whether i could make something that has a output like this Output Username: (Type...
[2 replies] Last: Well i plan to incorporate this into my main program which is run in t... (by mackw44)
How to make sentinel loop disregard -1
 
i have a program where i need to know the average of a string of numbers. the user inputs their numbers and enters -1 to submit the numbers, but when it calcula...
[18 replies] Last: Got the thing to work, thanks for all your help! (by paper32)
I/O, if statement
 
Brain is not functioning due to sleep deprivation.... say if you had these instructions: Write a program that calculates and prints paycheck information. ...
[3 replies] Last: I'm not 100% on this since I'm learning all of this too, but couldn't... (by Hippogriff)
by MH4
OpenGl and C++ music - How to play 2 music at the same time?
 
Hi guys I'm wondering if you guys know anything about how to play 2 sounds the same time? Currrently I'm using irrKlang and i dont think that i can play 2 sound...
[3 replies] Last: I'm sure it does. It wouldn't be much of an audio library if it didn'... (by Disch)
test scores
 
So if i have to write a program that dynamically allocates an array large enough to hold a user-defined number of test scores. Once all the scores are entered, ...
[10 replies] Last: I tried this and it didn't work. void arrSelectSort( double* arr, ... (by kdmpenguin)
Using Switch Case and It would not execute
 
I would appreciate the Help. The code would not execute. I tried to see what is wrong with playmultiplayer but I could not get it. In case 3 there an error wh...
[2 replies] Last: Thanks alot! (by abrofunky)
by Steves
Tic Tac Toe ending early
 
Okay so a few problems. Problem one: the program declares a winner when there is a marker in the middle, corner, and another corner, though it is not three in a...
[8 replies] Last: Ah = is used to make something equal. == is used to see if conditions ... (by Steves)
by Bnn678
How to correctly use the if/else statement when working with strings
 
When i use the if statement while working with strings, i always get the first option presented, as if it doesnt actually do the test just runs the first so her...
[2 replies] Last: Okay thanks that worked, also do you know how to use something other t... (by Bnn678)
Help with class declarations
 
Hi this is my first time working with classes/methods/constructors for my beginners C++ class. I just had a quick question. For my assignment I just created a c...
[3 replies] Last: Yep, account name should work fine. If you need a separate int... (by Hippogriff)
[HELP] learning pointers and need help :)
 
7. Assume an array is declared as, int age = {15, 21, 30, 28, 24, 19}; Show the code to display the value of age using pointer notation. not sure how to ...
[5 replies] Last: I had a real hard time with pointers when I was learning them too. If ... (by Steves)
by kyr3n
reading from an .xml file and manipulating read
 
Hello. I am trying to write code that separates specific items from within the .xml file this .xml file. Ive got the file to open from the console but I am s...
[no replies]
Permutations Problem
 
Hi i have this program i got off the net, im a beginner on this stuff so i try explain best i can :) i think programs have a sort in place to check if array ...
[9 replies] Last: And now we see why it's a good idea to plan before you program haha :) (by ResidentBiscuit)
Where to start.
 
Just asking the c++ gurus out there if my idea will work. My goal is to create a system to compare football players. I am a coach and would like to make a progr...
[4 replies] Last: If you are comparing ints, then you can change the double to an int at... (by GRex2595)
by Bnn678
Why is my varible considered undeclared?
 
I cant figure out why i keep getting an error message but it says the varible "gold" was not declared in this scope, here is a peice of my script gold=0;...
[4 replies] Last: #include <algorithm> string str = "YES"; //original string transfo... (by GRex2595)
February 2012 Pages: 1... 2930313233... 64
  Archived months: [jan2012] [mar2012]

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