beginner c++ question

Posted by: kswish0

beginner c++ question - 03/02/2004 20:40

I am in an intro c++ class and am having some trouble with a program. I basically have to make a simple math tutor. I have a certain form I'm supposed to follow. I have attached the source file for what I have done on this program so far. It is not complete yet, I still have to add the grade calculations, etc., but I want to get the menus working first (one step at a time). When I run this, it displays the first menu like I want it to, but when I give my selection, nothing happens. I figured it should be pretty easy for someone on this thread to see what I'm missing. Im sure it's probably something simple. And remember, I'm a beginner so don't laugh at my code. I know there are simpler ways to do this but I had to follow a certain form. Thanks in advance for your time.
Posted by: tman

Re: beginner c++ question - 03/02/2004 21:08

Take off the ; from the while loops...
Posted by: kswish0

Re: beginner c++ question - 03/02/2004 21:17

Thanks! I knew it would be something simple like that. I didn't have the semicolon after the main while loop, I dont know why I put it after the nested loops.
Posted by: Phoenix42

Re: beginner c++ question - 03/02/2004 21:30

Ah that brings back the memories.

While working on a program over the weekend while at home a friend of mine was having great difficulty getting it to compile and was just getting more and more frustrated with it. His father seeing this going on, and probably concerned that the monitor was about to get tossed out the window, suggested that my friend step him through the code explaining what each line was doing. About half was down they found the ;
Posted by: tman

Re: beginner c++ question - 03/02/2004 21:37

It is always like that though. Unless you're paying attention you'll miss that extra ; at the end because you're skimming through.
Posted by: tanstaafl.

Re: beginner c++ question - 03/02/2004 22:14

Ah that brings back the memories.


I remember working with my friend and business partner Dann. Truly a genius when it came to coding.

I would write a program that wouldn't work, spend hours trying to find out why and finally take it to him. He would usually find the problem in a matter of minutes (or less). He had this way of looking at source code with absolutely no preconceived notions of what was right and what was wrong. He would just digest it a line at a time and the bad line would jump out at him.

I was never able to develop that knack.

I got pretty good at spec'ing out a program -- determining what variables would need to be defined, what the general structure of the program would be, what the interface would look like. But Dann was the one who could write the clean code to really make it work.

Memories...

tanstaafl.
Posted by: Roger

Re: beginner c++ question - 04/02/2004 02:36

Take off the ; from the while loops...

And see if you can turn up the warning level on your compiler. Most modern compilers will say something to the effect of "empty controlled statement -- did you mean the extra semicolon?"