Here's what I think it should be: class Rectangle { protected: double length; double width; public:...
The idea of a function is that you pass in values that you want the function to operate on. If length, width and depth are always going to be...
Change the line Box::Box(double 10.0,double 20.0,double 30.0); to Box(double l,double w,double d); and remove the semicolons off the Box::Box,...
shabbir suggested you use fflush before calling scanf with the char type. Did that solve the problem?
Sometimes when I post a quick reply, I get the error message "This forum requires that you wait 10 seconds between posts. Please try again in 9...
So, you've removed half the code (probably including the code that has the actual problem) and the error message, and you want us to solve the...
No, because there is no such thing as a single programming language that covers all requirements. cf. COBOL - a high level business oriented...
This kind of problem is exactly why those of us that have been round the block a few times don't bother with scanf for input but use fgets to read...
Your DVD writing software will have a setting to make a disk bootable. If you don't know how, look through the menus, RTFM, Google it etc; it may...
A constructor constructs (i.e. initialises) the object, and the point of a ctor is to do that automatically rather than you having to do that...
> gcc is confused Hmm. Try using indentation properly if the problem is that "the compiler" is confused about code blocks. You'll probably find...
As I often say, try doing it yourself on paper. Write out (with the computer's help if necessary) 16 random numbers and see what the count would...
In Student::testgrade() you need to read in and return grades[0]. Still the strange constructor. What do you want it to do? Should it be doing...
Just set your favourite text editor to overwrite mode, start with an array of zeroes and change the appropriate characters to 1.
>I wanted to know if the constuctor is coded correctly No, because the assignments to stidnum, grades and totnumgrades will assign values to the...
Sorry about that; I should have RTFM...I never can remember parameter lists.
The C function strstr() tells you if a string exists within another string, e.g. strstr("Peter","Peter 25 m") would return TRUE. I'm not sure if...
The other reason it might not compile of course is that a sum of two vectors would be a vector, correct? Not a scalar, which is what your code is...
Let me guess, you're a mathematician, right? a=b; b=2; does NOT set a to 2, and if b was, say, 5 before all this, a would be set to 5. So you...
Add a printf statement that prints something useful, e.g. printf("Please enter a number: "); char buf[32]; fgets(buf,30,stdin); int n=atoi(buf);...
Separate names with a comma.