Beginners - September 2015 (Page 24)

Almost done with code, running into one problem.
 
The task is to write a C++ program that reads exam scores and displays the average score and the high score. I'm able to make the code do everything but display...
[3 replies] Last: Thanks so much, I'll try it. New to the code thing, so i appreciate it... (by ianheinze)
Need help in displaying the annual costs of my code??
 
Everything else displays and runs, except my annual cost function... Need help!! #include <iostream> using namespace std; //Function Declarations f...
[6 replies] Last: Hi, I am pleased you have a solution now :+) Did you see my PM ? The... (by TheIdeasMan)
by nnaass
addittion in an array
 
this is my first time with cplusplus.com i need help to write a program to ADD ALL THE PRIME NUMBERS IN AN ARRAY could some one provide a suitable program ...
[5 replies] Last: Hi, With a prime number algorithm, try this simple idea: - Take a li... (by TheIdeasMan)
Two sets of code with issues
 
I've written these two programs and am having serious debugging issues... I'm getting a really weird errors that have to do with the getline statement and th...
[2 replies] Last: I did mean to do that but I'm realizing that I actually have the math ... (by StoriesOfRen)
Print Number of Iterations in a While Loop
 
I am writing a program that the user guesses a number that is randomly generated. They keep guessing it until it is right and I did that by a while loop. I have...
[4 replies] Last: Wait a minute... I don't understand what the problem is. A. 'n' has t... (by minomic)
by h4ever
how to detect if key was or was not pressed previously?
 
Regarding WM_KEYDOWN message I have read: "In all four of the keyboard messages discussed so far, the wParam parameter contains the virtual-key code of the key...
[4 replies] Last: Ah, so it is the digit 31 counted from right to left... (by h4ever)
by franc0
Explain how to solve the problem without condition statements
 
There are 12 cookies per box (sold at $1.14) and 24 boxes per carton. Left over boxes are sold for 57ยข. Remaining cookies are given away free. Given the numbe...
[1 reply] : Simple math: leftover cookies: total_cookies % 12; total boxes: total_... (by MiiNiPaa)
by Guard
Output symbol art after taking in commands from input file
 
Hello all. I've been working on this program but have become stuck. This program is supposed to take in commands from input file(commands.txt), read and underst...
[2 replies] Last: Yeah, forgot to delete the old version of my code. This is a more upda... (by Guard)
Problem with union and intersection of two character strings
 
My Professor gave us this as homework (which i am having difficulty understanding) My textbook has nothing on union or intersect. Write a C++ program that...
[3 replies] Last: not understanding what the intersection or union does https://en.wik... (by MiiNiPaa)
Trouble With Loops
 
Hello, My program is meant to calculate the shooting percentage of a hockey team. It's an assignment I've had to build on over the last few weeks and for thi...
[2 replies] Last: I'm not sure I am following. What I am trying to do is create a progra... (by SacrilegeSC2)
Discerning highest number from text file
 
Hello, I am trying to decipher from a text file who sold the most boxes. I am able to print to the screen the individual volunteers and the boxes they sold....
[2 replies] Last: #include <iostream> #include <fstream> #include <string> #include <iom... (by ahmplantee)
by JanoOr
dirty little vectors and why they don't want to stay together
 
Hey, the basic idea is to concatanate two vectors in a big one. Unfortunately I get the error: terminate called after throwing an instance of 'std::length_error...
[3 replies] Last: Thank you very much. You both are right! Returning a vector iterator f... (by JanoOr)
by cCj
converting to hex error
 
Hi I was trying to build a hex string from three integer values (r,g,b) but sometimes the output is slightly wrong. when this code is supposed to print FFBF0...
[2 replies] Last: @Peter87 Thanks, that was it. (by cCj)
vectors
 
is we write vector code in turbo c++ if yes please send me the code
[2 replies] Last: Turbo C++ is decades old and is missing the standard template library.... (by dhayden)
Missing numbers
 
Hello guys! I'm kind of a "new kid" in this c++ thing, so I'm trying to learn things trough some tasks and answers.. (today trough hackerrank site) So, firs...
[2 replies] Last: First, I highly dislike the style of the program, C++ programs should ... (by Kevin C)
Roulette Program Help
 
When I run the program at this point i am getting some issues. If I put in 1 or 2 for color it doesn't skip to the else and do the spin procedure. Also if I inp...
[2 replies] Last: Something else you could do to optimize your code is on line 19 you do... (by mindoo)
by b4r0ck
Get the "name" of an element in a vector
 
Hi, I wrote a very simple code, I want to display the name of the character, but I can't figure it out how I could. Thank you in advance. class Player{ publ...
[4 replies] Last: Thank you so much, it works! (by b4r0ck)
a cycle for a number of times
 
Hello forum, I have four different functions as follows: void func1(); void func2(); void func3(); void func4(); And each of the a...
[7 replies] Last: Precedence: (this->*a[i%4])(); (by MiiNiPaa)
convert a string 1441970667234 to date, time_t; atoi
 
Beginner in c++, il would like to convert a string "1441970667234" to date. const char time_as_str = "1441970667234"; time_t t = atoi(time_as_str); ...
[1 reply] : 1) You have overflow here: 1441970667234 will not fit into int. 2) Act... (by MiiNiPaa)
by Haziq
Game in C++
 
Write your question here. #include <iostream> #include <cstdlib> #include <string> #include <stdio.h> //switch #include <fstream> //input output t...
[6 replies] Last: ew, system("cls"); http://www.cplusplus.com/articles/j3wTURfi/ I ha... (by Radar)
September 2015 Pages: 1... 2223242526... 42
  Archived months: [aug2015] [oct2015]

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