Beginners - March 2016 (Page 13)

Rectangle Area Homework
 
For my homework assignment, I'm supposed to create a program that asks for length and width of a rectangle, calculate the area then display it using 4 different...
[2 replies] Last: Yes, see line 15 and what is that missing for line 16. Read the run-ti... (by mike99)
Debugging
 
I'm getting a few errors when compiling. Here is one. string.cpp:16:1: error: prototype for ‘String::String()’ does not match any in class ‘String’ St...
[1 reply] : Hi, Looks Ok so far, maybe we need more context ? Is String.hpp incl... (by TheIdeasMan)
by rantiv
Pointers
 
You have been given a Student class. A user will insert multiple names followed by the word "STOP" With each name, create a Student pointer and insert it int...
[7 replies] Last: perfect i got it! i was just missing the -> again (by rantiv)
Function Arguments
 
I have a couple questions that I am not sure how to answer for a review before my midterm. What kind of argument can you pass to a function in the place of...
[5 replies] Last: After reading another resource I understand it now. for the first fcn... (by nfectgotan)
Can anyone help me find a bug in few lines of code?
 
When i type in ( 2 5) and ( 10 20) the answer is 40/0. I have something wrong in my denominator but I can't see it. #include <iostream> using namespa...
[1 reply] : Hi, In function 'int main()': 12:50: warning: 'denom1' is used uni... (by TheIdeasMan)
While loop(possibly vector) issues
 
Hey guys, so Im having trouble with this while loop. on my getlin (cin, n) after 1 loop through it skips the first character entered. I have no idea why, have n...
[2 replies] Last: When I don't use cin.ignore() it skips the whole getline (cin, n) .... (by b29hockey)
Having trouble with variables in different functions for a calculator
 
Hey guys I am new with C++(started 2 days ago) and I made two different projects for a simple calculator with very basic arithmetic expressions, the first proje...
[4 replies] Last: Hi, Good work ! Not a bad effort for 2 days coding :+) I really like ... (by TheIdeasMan)
How to use fstream to manipulate files
 
I need to write a program that reads a file and outputs it in another listed format. My teacher hasn't really went over the subject very well and I don't have m...
[3 replies] Last: Check out this page: http://www.cprogramming.com/tutorial/iomanip.html... (by caolan)
Calculating interest due
 
I have coded this as best as I can; but, after writing my else if statement I realized the third component that I have to program won't work properly with what ...
[2 replies] Last: One other thing, these variables are not currently being used: st... (by caolan)
help me
 
I am trying to make a simple calculator but it isn't working can someone help #include <iostream> using namespace std; int main() { int a...
[3 replies] Last: Take a look at you if-statements. They are not specifying chars to com... (by caolan)
If / Else statement assigning incorrect values
 
Are these 'if' statements possible? If a user selects county A and the dog is fixed, a certain value will be assigned to cost. I would like both to be true in o...
[1 reply] : You can see here http://en.cppreference.com/w/cpp/language/operator_pr... (by Moschops)
practicing arrays
 
Hello all. I've been practicing with arrays and was wondering if anyone can tell me why my code is spitting out so many indexes as well as not the correct numbe...
[1 reply] : Note that if line 12 condition is true, then tmp is 0 and there is n... (by keskiverto)
If/else statement
 
When Running this program, after the user inputs the weight of the dog the output repeats itself twice. example: Enter your dogs weight >> get weight "your...
[1 reply] : I fixed it by completely changing the code. <code> // Cassandr Hamr... (by CassandraB)
Why doesn't my program return 0 if the output overflows?
 
My program takes an user input integer and outputs the reverse. However I need to produce 0 if the reverse overflows a signed integer. I've tried manually with ...
[4 replies] Last: How do I check the new value of reverse against the old value? ... (by dhayden)
Rectangle or Square Calculator
 
Hey guys, I am supposed to write a program with a set of points, x1,y1 x2,y2 x3,y3 and x4,y4. This program is supposed to take the points into effect, and tell ...
[2 replies] Last: Your algorithm is wrong. Check it out on paper - given corners (0,0), ... (by fredk)
by toy
Help with finding minimum element in a stack
 
I am trying to code finding minimum element in a stack by only using stack(no other data structures, such as vectors or lists, are allowed). when computer te...
[1 reply] : I don't understand your restrictions (and the code looks complex too).... (by keskiverto)
Doubly Linked List Problem
 
This is part of a larger project im working on for class and I don't need answers to it I just feel like im not quite grasping the proper way to implement a DLL...
[1 reply] : Why does a Node have a curr pointer? A node is just one node. If any... (by dhayden)
Problem with printing board?
 
I've created a tic-tac-toe game than can be played against the computer, the board seems to change correctly, but there seems to be an error in printing the boa...
[2 replies] Last: Done, I included string, cstdlib, I used srand(time(NULL)) in the star... (by jgg2002)
How do i link ncurses to c++, in gcc
 
How do i link ncurses to c++, in gcc? I am on a mac and I cant find out how to link it. I used -lncurses and -l:/Path/to/ncurses. I always get this error. ld: ...
[2 replies] Last: thanks so much. I got it working. I even wrote a simple python script ... (by aarongillbraun)
Quadralateral
 
Hey guys, I'm new to C++ and have a problem here. My code is below, it is just in a separate class so the main is in another. I need to finish my two 'isRectang...
[14 replies] Last: what did I do wrong on line 64? It is just saying if all sides are eq... (by keskiverto)
March 2016 Pages: 1... 1112131415... 47
  Archived months: [feb2016] [apr2016]

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