General C++ Programming - March 2014 (Page 27)

The history teacher at your school needs help in grading a True/False test.
 
The students’ IDs and test answers are stored in a file. The first entry in the file contains answers to the test in the form: TFFTFFTTTTFFTFTFTFTT Every...
[3 replies] Last: Not sure what else you are doing. The code compiles fine (with a few w... (by Smac89)
by MrMoe
Base class pointer and polymorphism
 
Hi, I'm trying to implement an evolutionary algorithm for an optimization problem and I need some advice on how to structure my program and how to use polymorph...
[4 replies] Last: Thanks again for your comments. To be honest, I've never heard of visi... (by MrMoe)
Recursive adding elements in array
 
The goal of this program is to take 4 neighboring elements in an array and add them together. The program asks user for the number of rows and columns to start ...
[3 replies] Last: YPu clearly changed it wrong, because it should compile. And post your... (by MiiNiPaa)
Using singleton in c++
 
I created following classes in my program. Way.h class Way { private: std::string id; std::string name; public: Way(); Way(const Wa...
[1 reply] : Way::Way(const Way& orig) { } void SetOnGoingWay(Way onGoingWay) //i... (by ne555)
by Dare
Someone pls help
 
//To practice writing programs using loops.Write a program that will allow the user to buy notebook(s), pen(s), pencil(s) and / or a calculator from your stor...
[1 reply] : So? What the problem is? (by MiiNiPaa)
by niuxe
The gussing game
 
Hi, I've just started c++, and I've tried to code the guissing game, but I ran into some truble when I wanted to exclude letters, and when I put in a repeat fun...
[no replies]
How to round to the nearest odd? C++
 
I want to make any decimal point in even to go to odd and any decimal point in odd stay as odd in C++. 2 to 2.9 becomes 3. 1 to 1.9 becomes 1. I would li...
[2 replies] Last: Using <cmath>... //Pseudocode If(floor(x) / 2 != 0) //If the number... (by Mats)
C++ Class Assignment, Need Assistance ASAP
 
Ok, so my assignment is to write a program that computes how many feet an object falls in 1 second, 2 seconds, etc., up to 12 seconds. The formula is: d = ½ * ...
[1 reply] : 1) Please use code tags when posting code, to make it readable: http... (by MikeyBoy)
by quayda
Sentinel not working....
 
I'm not sure why this isn't working, but this is my error message: Error] no match for 'operator!=' (operand types are 'std::string {aka std::basic_string<cha...
[2 replies] Last: Yeah, that was the problem I was able to fix that, but now I'm struggl... (by quayda)
Matrix Multiplication
 
Hello, I have a program matrix multiplication but it work not for big arrays. I dont understood what is problem.Anyone can help me? n should be bis 200. ...
[6 replies] Last: how can ı write as a matrix : double* x = new double[n*n]; for (int... (by candidate)
game timer suggestions
 
I am making a maze type of game and I was wondering, how would I create a background timer that keeps track every 120000 milliseconds and would then render an e...
[2 replies] Last: > code example would be a big help. #include <iostream> #include <fu... (by JLBorges)
Tic-Tac-Toe
 
Hello, I've been working on an AI program that has two AIs going against each other in tic-tac-toe. I've been working on translating it from Java to C++ becaus...
[1 reply] : AIPlayer.hpp #ifndef AIPLAYER_HPP_INCLUDED #define AIPLAYER_HPP_INCL... (by crimsonzero2)
How to make random letters with a vector
 
Hi, everyone. Thanks in advance for helping. I have read the related topics to mine, but none of them made sense to me. I am supposed to make a scrabble game...
[2 replies] Last: #include <iostream> #include <vector> #include <string> #include <alg... (by JLBorges)
DFS
 
Hai i am new to the world of competetive programming...I have just started to learn data structures...I would like to get an idea on how to solve the following ...
[no replies]
use of double or float in array
 
Can you use data type double or float for an array? ie double n ; or float a; float m ; My code wont accept me changing the data type..will on ...
[4 replies] Last: You can have an array of any data type. The offset must be a signed or... (by giblit)
Rounding to nearest half?
 
******EXTREMELY NEW TO C++***** C++ Question: How do I round to the nearest half integer? Example; 0 to 0.2 = 0 0.3 to 0.5 = 0.5 0.6-0.9 = 1 ...
[4 replies] Last: #include <iostream> #include <cmath> int main() { double a = {... (by JLBorges)
Static member/function errors.
 
What am I doing wrong with static members and methods here? compiler errors: 1>test.obj : error LNK2005: "private: static int Test::count" (?count@Test@@0HA...
[4 replies] Last: Thanks, L B and long double main (I obviously just missed your reply b... (by trainbike)
by kok23
ASSISTANCE NEEDED: Incremental Program Development, Vectors/Arrays, Loops, Output formatting
 
**I have a project that, unfortunately, the professor has not taught the class how to do. We use Dev-C++ programming.** INSTRUCTIONS: 1) The product and pri...
[no replies]
If function is false, the else works. If true, segfault.
 
I have this function: bool login(const string& username, const string& password) { if(user_exists(username)) { ifstr...
[6 replies] Last: Haha, I got a broken gdb or anything like that. I'll test your code. (by iQChange)
fstream and replace question
 
Hello, I'm supposed to be able to replace a word within an input file (and in this case my input file is my main.cpp file) with the same word but in uppercase f...
[1 reply] : ¿do you know what else means? look at how the lines were replaced ... (by ne555)
March 2014 Pages: 1... 2526272829... 36
  Archived months: [feb2014] [apr2014]

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