Beginners - March 2016

by bgcm
have something happen every (e.g.) 15th cycle of an oscillator
 
Write your question here. here is code that works every cycle: // non-lin (oscillator), Last point approx. (Cromer) version (w/ quadratic dissipation and mom...
[no replies]
Adding and Subtracting to a global int
 
How would I go about declaring a global int in a header file, then manipulating it via addition and subtraction in the .cpp file. Every time I tried "health + 1...
[2 replies] Last: The error was that I was using "+" instead of "=+", whoopsie. Thanks f... (by Sariasdong)
Review for a test help please :S
 
One of our review questions is the following: Be able to describe how to overload an operator as a class member vs. a friend function, and when you cannot ...
[1 reply] : no, that's incorrect. A member function has access to the private memb... (by ne555)
Trying to Manipulate then display a user-inputted c-string.
 
I'm writing a password suggestion program(win32). So what I need to do is first take a user inputted c-string, then manipulate it to exchange certain vowels wit...
[no replies]
by Sh14
I/o Files
 
A file with random numbers was provided and from that, a code needs to be produced to make 3 other files (one listing all the odd numbers, one listing all the e...
[no replies]
Assignment Due Tonight So Close Help!
 
Guys, I have an assignment due by EST 11:59PM tonight. I'm so close. I posted my code below and the assignment. I'm using DEV C++. Please show me what I'm ...
[1 reply] : No need to create objects on the heap for this. int main() { Sal... (by Moschops)
Loop wont quit
 
I have to write a program that calculates contestants final score by dropping the highest and lowest score received and averaging the three remaining scores. In...
[1 reply] : Below your do while loop you have: { // Get 5 judges scores for ea... (by Outlaw782)
by Amoun
variable assignment
 
I'm implementing the function "sum" which add the pixels of an image here's the code float sum(cv::Mat img, int startedX, int startedY, int w) { float res = ...
[2 replies] Last: The function returns a result : std::cout << "result= " <<sum(imgMa... (by Amoun)
Please Help Class problem!
 
Here's the code : #include <iostream> #include <cmath> #include <string> using namespace std; class Register { public: void Registering() ...
[1 reply] : Register rkey; Register.Registering(); Registering is not a static m... (by Thomas1965)
Tic-tac-toes game; computer vs human
 
I am trying to make it so that if the human enters an number of a space that is already occupied, it will give an error message and not continue the program unt...
[no replies]
Converting int to binary
 
Hello! I'm currently working on writing a function that will convert an int to binary and return it as char*. I've been instructed that it would be better to in...
[3 replies] Last: What if the 'string' does not point to a sufficiently large array? (by keskiverto)
Brute force
 
I have a texte crypted with the "code Vigenaire" and I have to youse the brute force method to decrypt it. I don't really know how to code that. Can someone hel...
[4 replies] Last: oh yes thank you! the link was not good opened on my computer! (by lemniscate12)
by rantiv
PLEASE HELP!
 
How do i use the parent Shape class' toString function to implement the Rectangle toString function. It should print out the same information, and in the same f...
[2 replies] Last: thanks! (by rantiv)
by csnook
Trouble with constructor in abstract class
 
I am working with virtual functions and run-time polymorphism. The issue I am having, which its preventing me from doing anything else with this program, is my ...
[5 replies] Last: No. SalariedEmployee has a constructor that takes an int, and passe... (by MikeyBoy)
Validating loop input and writing to file
 
I have to write a program that uses files and nested loops to create a file from the quiz grades entered by the user, then read the grades from the file and cal...
[3 replies] Last: Your logic is wrong. outfile<<grades<<" "; //send grades to file if ... (by Thomas1965)
by rantiv
NEED SOME HELP PLEASE
 
When your program is run, you will be given 2 sets of 3 inputs which you should use to create the appropriate objects: a string representing the type ("student"...
[1 reply] : std::string type; std::string name; std::cin >> type; if ( "foo" == t... (by keskiverto)
lost in the homework sauce
 
My professor says there is a bug in my program but I cant figure it out. could anybody hint at what this bug is that is so obvious. #include <iostream> #incl...
[9 replies] Last: I understand the use of the modulus and the int /int = 0, but what's ... (by dhayden)
How to access protected object in c++
 
can anyone access protected object in c++ , if yes then how to access protected object from a class??
[1 reply] : "protected" means that the object can be accessed by that class, and b... (by MikeyBoy)
Need Clarification On Using Arrays To Count Characters
 
I've been given an assignment in my programming class to write a program that prompts the user to enter a sentence and then the program tallies each character i...
[2 replies] Last: Thank you very much for solving my problem. Seeing as this is homework... (by Biohazard186)
March 2016 Pages: 123... 47
  Archived months: [feb2016] [apr2016]

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