• 0

Programming help!


Question

Hey guys, posted this in the newbie section, but technically i`m not a newbie!

"Hey guys, i need some BIG help.

Its the last 2 weeks of my computing course at college and i am panicking over my program, the tutor isn't allowed to help me with the program all he can do is say whether its wrong or right and what i need to do next etc.

Anyways, i have the program half done at least, but now i am completely stumped, i was wondering if someone here could add me on msn and help me finish the program, i wouldn't bother asking but i suck at it and its not my strong side not to mention its a required credit to pass HNC computing! "

Link to comment
Share on other sites

Recommended Posts

  • 0
Asking for help would be giving the errors he is seeing, I have yet to see them in this thread. Pasting the code doesn't tell anyone about the problems and gives the impression of 'here is my code, please fix it' even if it isn't worded like that.

If you look at my first reply in this thread, I explicitly stated that I was referring to the thread author's first post only, not the posts of his afterwards. Posting code or errors would aid him in his quest for help, but, if I was somebody who was helping him, I would expect those in subsequent posts, if they weren't evident in his first post.

In his first post, he asked for help and then the person I quoted replied straight away, bashing him for asking for help :s As somebody who is studying programming and who often asks for help in order to understand things, I felt the need to reply :)

Link to comment
Share on other sites

  • 0

At my university they actually pay some students to act as demonstrators and help students with their programming assignments.

There is a big difference between plagiarism and pointing someone in the right direction, or just telling them "oh that happens because of this"

I'd like to see some error messages. They can often seem quite cryptic but make sense when you learn what they are.

Link to comment
Share on other sites

  • 0

The problem i have now is i cant post the errors, because visual studio 6 doesn't work in windows 7 (even under compatibility mode)

And Visual studio 2008 is completely different and i have no idea how to use it! :-(

Link to comment
Share on other sites

  • 0

So wait, if you can't even run VC6, then how do you know you are getting compilation errors in the first place? And if you can use VC6, you can use VC9; if anything, VC9 is much friendlier than VC6.

As someone who has tutored C/C++ students before, I have to re-emphasize post #18. VC's error messages are generally pretty good--much more so than something like gcc. And there's a difference between telling people what to do and guiding them towards what to do. A student should at least first explain what they think think the problem might be and what the error might be indicative of and why they think that...

Link to comment
Share on other sites

  • 0

Well because i do the work at college you see, i try to keep it out of my home time but i cant now, so i tried installing Visual studio 6 (provided by college) and it doesnt work on vista or windows 7(even in compatibility mode)

Im basically screwed as i cant access neowin in the college, im NOT gonna let programing fail me after a whole year of excellent work, i got an A in my main exam and have passed everything else with ease.

Not to mention i have an exam on programming this thursday(the day my programs meant to be in) :-(

Link to comment
Share on other sites

  • 0
I basically could do it if i really wanted to, but i don't.

Well... if you give a **** about college you would get off your arse and do some work.

I had to do plenty of crap modules in university, but if i was having trouble I would just work harder.

Dont mean to sound like an a-hole but if you're capable of completing the assignment but just too lazy to put the work in then you dont deserve our help.

Link to comment
Share on other sites

  • 0

void fillArray(cust customers[], int &rows);
char name[21];
/*do
{

The above is from the end of his program, aren't comments supposed to be closed, and does anyone notice the curly bracket is facing the wrong way; of course I am assuming that the whole program was displayed in the codebox on the first page.

Link to comment
Share on other sites

  • 0

Well, um, the error message are very useful (I just tried compiling it on VC6 just for the heck of it; I did have to extrapolate what that mystery input.h provided). Just double-click on the first one you see and it will take you to the line with the problem. Examine the line. See what's wrong with it. Fix it. Compile again (to see if fixing that error also fixed others). Lather. Rinse. Repeat. As a super-super-generous estimate, I'd say that it shouldn't take more than an hour--probably much easier and less time-consuming than trying to solve it with a forum.

Link to comment
Share on other sites

  • 0

OK so, maybe my attitude stinks in peoples eyes, but im just being 100% honest.

Wether i like it or not i have to do this program, i think i have done extremely well to get from knowing nothing about programming or even caring about it at all to having written a fair bit of code and learned lots even though a part of my brain knows i will likely never use it again when i work.

Ive installed virtual xp on windows 7 (which is awesome btw) and i will try and work through the errors myself for the umpteenth time.

Thanks.

Link to comment
Share on other sites

  • 0

If the trouble you're having is understanding the errors, either paste them here or google them and learn what they mean. If you know what they mean but can't fix the code, or think the code is right, paste the few lines of code around the reported error line.

Link to comment
Share on other sites

  • 0

Ok so, i wrote the program all by myself, i dont have visual studio 6 to test it out at home, i wrote it in visual studio 2008(i have no f`ing clue how to compile and run it and check for errors in VS2008 why is it so different?)

So, if i paste the code here, can someone please tell me if it works and also maybe give me a few pointers on how i could improve it or do something to the same effect with less code i.e streamlining, code organisation etc as i am somewhat of a novice.

I am not cheating now am i because the programs 100% complete i am just asking for pointers

Ive attached it along with the input file reqired to run it, you will just have to change the destination folder in the code.

project.zip

P.s i would greatly appreciate the advice, the deadline is tomorrow at 4pm, which is 21 hours away! and i will be spending 6-8 of that sleeping.

Edited by cammy
Link to comment
Share on other sites

  • 0

I don't have time for this but using VS2008 is easy, if you have familiarity with VS6 the transition should be very smooth.

In VS2005 and above, building is F6, or Build -> Build Solution (assuming you have only one project). Running is F5, or Debug -> Start Debugging. In general, you can just hit F5 and if the project needs to be built, VS will ask you for it.

Link to comment
Share on other sites

  • 0
I hope they put this through plagiarism detection and it has enough time to index this thread :)

Plagiarise his own code he posted?

There is nothing wrong with asking for help, we are not writing the whole code out for him.

Im on my way out the door but looking at the code <input.h> should be "input.h" (well its <n:\cpp\input.h> in your code but i changed it to test myself, so it should be "n:\cpp\input.h"). Ill take a better look after work If i remember :p

Edited by Doli
Link to comment
Share on other sites

  • 0

I've been going through the code and it looks fairly good. The main problem seems to be sloppy errors. It looks like you wrote it without even trying to compile. When I attempt to compile it with the current MinGW I noticed 2 blatant errors. First, you need to remember that C++ is a case sensitive language. You have several functions that fail to compile because they are using the wrong case. (For example, use "WriteFile" instead of "writeFile".) Second, apparently you forgot the names of several variables and functions you initialized partway through and, instead of looking to see what they were, just guessed at what they could be, and in some cases guessed wrongly. (For example, in "struct cust" at the beginning of your code you initialized several variables, including "float currentbal" but in several places later you decided to use the uninitialized variable "currbal" instead.)

Link to comment
Share on other sites

  • 0
I've been going through the code and it looks fairly good. The main problem seems to be sloppy errors. It looks like you wrote it without even trying to compile. When I attempt to compile it with the current MinGW I noticed 2 blatant errors. First, you need to remember that C++ is a case sensitive language. You have several functions that fail to compile because they are using the wrong case. (For example, use "WriteFile" instead of "writeFile".) Second, apparently you forgot the names of several variables and functions you initialized partway through and, instead of looking to see what they were, just guessed at what they could be, and in some cases guessed wrongly. (For example, in "struct cust" at the beginning of your code you initialized several variables, including "float currentbal" but in several places later you decided to use the uninitialized variable "currbal" instead.)

Lol yeah, i wrote it in notepad, i couldn't understand how visual studio 2008 works, have only ever used visual studio 6, i will take a look through it again and look for such daft things i did.

Apart from that is there no way you would improve the program itself?

Link to comment
Share on other sites

  • 0
Ok so, i wrote the program all by myself, i dont have visual studio 6 to test it out at home, i wrote it in visual studio 2008(i have no f`ing clue how to compile and run it and check for errors in VS2008 why is it so different?)

So, if i paste the code here, can someone please tell me if it works and also maybe give me a few pointers on how i could improve it or do something to the same effect with less code i.e streamlining, code organisation etc as i am somewhat of a novice.

I am not cheating now am i because the programs 100% complete i am just asking for pointers

Ive attached it along with the input file reqired to run it, you will just have to change the destination folder in the code.

project.zip

P.s i would greatly appreciate the advice, the deadline is tomorrow at 4pm, which is 21 hours away! and i will be spending 6-8 of that sleeping.

I tried to compile it with Code::Blocks and and VS2008 and I won't compile on either for various errors

Within your input.h header file you seem to be missing another include

You have #include "console.h" but it's not in your zip file. I'm assuming its a file you've made rather than a standard header file. If thats the case, a lot of your errors might disappear.

Lol yeah, i wrote it in notepad, i couldn't understand how visual studio 2008 works, have only ever used visual studio 6, i will take a look through it again and look for such daft things i did.

Apart from that is there no way you would improve the program itself?

Worry less about improving the program, and more about making sure it compiles, and does what it is meant to do. Also, you should add comments to all of your code, explaining its operation. For example a few lines at the top of functions, saying what the function does, maybe what parameters it takes and what it returns.

Link to comment
Share on other sites

  • 0

With a bit of work I got it to compile but it's not working. It only gets as far as the menu screen but crashes when I choose '1'

I'll post the code, and its your choice what you want to do with it.

code.zip

Link to comment
Share on other sites

  • 0
With a bit of work I got it to compile but it's not working. It only gets as far as the menu screen but crashes when I choose '1'

I'll post the code, and its your choice what you want to do with it.

code.zip

Thank you man, you have been a big help to me, i don't understand why the sub menus don't work either, i will need to look into that all night to find out, i really appreciate the help, i couldn't see the errors anymore because i had been staring at it for days on end.

any ideas why its not working? i wont be able to get any more help on the subject as its due in 13-14 hours time and i still have all the documentation to write :-(

Link to comment
Share on other sites

  • 0
Thank you man, you have been a big help to me, i don't understand why the sub menus don't work either, i will need to look into that all night to find out, i really appreciate the help, i couldn't see the errors anymore because i had been staring at it for days on end.

any ideas why its not working? i wont be able to get any more help on the subject as its due in 13-14 hours time and i still have all the documentation to write :-(

Since I feel sorry for you i'm going to install VC6 and see what I can do... I'm not a programmer. I was a Computer Science major in college but dropped out to pursue a career in Systems Administration. That said, I don't know C++. I know VB6, Java & PHP. Apparently Java is very similar to C++, so maybe I'll be able to help. No promises, but just wanted to give you a heads up.

BTW, if your computer can handle it, I'd recommend installing VC6 in a virtual machine (perhaps VirtualBox, being that it's free). Otherwise, just run it in XP Mode like you were saying before. You know that you don't have to run the apps under Windows 7, though. You can load the XPM main window and run the apps in there (if you were having any trouble running them in the standard "native" 7 window.

Link to comment
Share on other sites

  • 0
Since I feel sorry for you i'm going to install VC6 and see what I can do... I'm not a programmer. I was a Computer Science major in college but dropped out to pursue a career in Systems Administration. That said, I don't know C++. I know VB6, Java & PHP. Apparently Java is very similar to C++, so maybe I'll be able to help. No promises, but just wanted to give you a heads up.

BTW, if your computer can handle it, I'd recommend installing VC6 in a virtual machine (perhaps VirtualBox, being that it's free). Otherwise, just run it in XP Mode like you were saying before. You know that you don't have to run the apps under Windows 7, though. You can load the XPM main window and run the apps in there (if you were having any trouble running them in the standard "native" 7 window.

Ok, I fixed one error immediately by removing a semicolon that you had after an if statement. I can't remember where it was, but just look out for that. Even if you're not using brackets (for a one-line if) you don't put the semicolon after the if statement; just after the action that is performed.

More to come, hopefully...

Link to comment
Share on other sites

  • 0

If I debug the program and select "1", I immediately get an error message saying "Unhandled Exception. Stack Overflow". at void GotoXY in input.h.

Link to comment
Share on other sites

  • 0

That's cause it's cause it's caught in an infinite loop. The function gotoxy is defined as GotoXY but GotoXY calls gotoxy which is basically calling itself.

Link to comment
Share on other sites

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.