1. Computer problem? Tech Support Guy is completely free -- paid for by advertisers and donations. Click here to join today! If you're new to Tech Support Guy, we highly recommend that you visit our Guide for New Members.

NEED HELP FAST for unfair C++ assignment

Discussion in 'Software Development' started by GameMaster13, Nov 2, 2007.

Thread Status:
Not open for further replies.
  1. GameMaster13

    GameMaster13 Thread Starter

    Nov 2, 2007
    Hello all. I am a (nearly) straight 'A' university student, who despite having followed my curriculum exactly as intended and meeting all prerequisites, have found myself forced into a class with fairly moderate C++, without the school having yet given me any proper C++ training.. (I only know the basics currently, from my own experience.)

    I currently have a very frustrating assignment, for which there is virtually no help for in any of my course materials, and the instructor does not even seem to know what he is talking about and gives me annoyingly vague, confusing answers whenever I email him questions (and now he doesn't even respond at all !)..

    Please, I could really use some help as I am stuck and need to have this assignment done by Sunday, 11:59 MST, though I may be able to get it extended if necessary (but am not sure that would be allowed)..

    I have ATTACHED the ASSIGNMENT INSTRUCTIONS (" Data Structures and Artificial Intelligience with Lab FALA07 - Sec B.pdf "), as well as the current state of MY CODE (" main.cpp ") in the .zip file. If for some reason the attachment doesn't work, I have also uploaded it to the following URL:


    This is a Win32 console project done in Microsoft Visual Studio, as I am sure you would see from my assignment instructions.
    Basically, I am stuck on the the Union and Intersection portions, as my course materials have no reference for how to do this whatsoever.. My program currently just outputs all values in the set rather than the appropriate values (as shown in the screen capture at the end of the assignment instructions).. In addition, I am not sure if the rest of the program is correct, due to inconsistencies between the assignment instructions and the vague responses I have gotten from my instructor.

    Thanks to you all in advance !..

    Attached Files:

  2. Mikrondel


    Jun 21, 2005
    Your problem is not stricking to your specs:

    // insert a new value only if it is unique (not already in the set)
    void Insert(int newValue) {

    Your Insert function does not check whether the new value is unique. If it did, your Union function would probably work. Furthermore, you simply rewrote InsertFront! You might as well just call InsertFront from within Insert.

    In fact, I think that's what they expect you to do - FIRST call search to check if the value is already there or not, and if not, use InsertFront to add it.

    Personally, I would store the list in numerical order as this is significantly faster; however the above method will work without errors, and as I said, is probably what they expect you to do.

    Intersection is a simple matter of adding everything in the first set that's a member of the second set.

    Good luck!
  3. klam


    Apr 21, 2006
    OK I'm sorry but I can't help myself from writing this. You say you're "nearly" straight A student in some random university, as if it was very impressive (unless you're from Oxford, cambridge, MIT, etc), and then instead of asking direct questions and debbuging your program, you send whatever piece of code you have and ask for people to please fix it FAST.

    Furthermore you complain by the fact that they haven't teach you C++.. and classify your assignment as "unfair" oh well, poor you... there's google and at University (deVry... is that even a university?, really? looks like an e-learning college to me) level you reeeaally should know by now how to use google, don't you? and OMG it's an assignment for dummies! it even gives you screenshots and most of the code you need come on!!

    I really wonder what univeristy you come from cause jeez... a "nearly" A straight student with a profile such as your makes me want to cry.

    Oh, and are we even supposed to solve homework? I'd be happy to answer any question you have, but to fix your homework that's another thing.. I mean.. i feel so sorry for you... I can see why your professor doesn't want to get back to you AT ALL.
  4. GameMaster13

    GameMaster13 Thread Starter

    Nov 2, 2007
    Just thought I'd post a response, in light of what has been posted here being brought to my attention.. Thanks for your help guys, though I had already figured out the aforementioned assignment not long after my initial post..

    @ Mikrondel:

    Ditto. I had suspected as much regarding the Insert() function from the start.. I mainly just had the InsertFront() code pasted under the Insert() function to serve as a temporary placeholder.. I knew the code was likely not correct, but at the time I had nothing else to go on.. Once I did figure out the code for Insert(), I discovered that my Union() function needed no modification and then the Intersection() function followed easily after that..

    The key ultimately was getting the Insert() method to utilize the functionality of the search method; everything pretty much fell into place after that.. What initially threw me off was that the Insert() function (within the lab instructions) had no empty lines between the brackets, while the Union() and Intersection() functions DID.. This led me to believe it implied that the Insert() function needed no modification, only Union() and Intersection()... Obviously, that was not the case.. I blame that as the result of poorly written lab instructions.

    Just for the hell of it, I'll attach the final revision of my code which I submitted for credit.. in case anyone is interested..

    @ klam:

    Such ignorance in your response, clearly you misunderstand the situation.. To clarify some things.. I was NOT trying to sound impressive, only to illustrate a point, that being that despite the fact that I am a mostly straight 'A' student with above average intelligence, even I am finding myself stumped by the assignment.. That was due to it being given to us within an unfair context, being unnecessarily difficult for all the wrong reasons.. At that point in the curriculum (assuming one had followed it religiously and had no prior programming experience), the majority of the class had little to no prior C++ experience..

    Regardless of how intelligent one is, immediately jumping from Step 1 to Step 5 in unfamiliar territory would be a problem for most people.. especially when it comes unexpectedly and out of context within a short period of time and one is forced to apply knowledge which one does not have to complete an assignment in under a week..

    While this exercise may have seemed simple to you, it is not the case for everyone.. In retrospect, I'll admit I sounded somewhat desperate in my initial post (which I kind of was at the time), so it probably comes across sounding worse than it actually is.. Nearly my entire class was puzzled by that particular lab, and I was the one (believe it or not) to finally bring some answers to them.. So by referring to me as a 'dummy', you are by proxy referring to my entire class as 'dummies'.. I doubt that is the case.. Please think before you speak of that which you know little about.

    Anyway, it turns out that lab was mostly a fluke, perhaps to get us introduced to the material head-on (or more likely a gross oversight by those responsible for setting up the curriculum).. Either way, the labs are much more manageable now and progress much more logically.. The course is now actually somewhat fun and appropriately challenging..

    Attached Files:

As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 733,556 other people just like you!

Thread Status:
Not open for further replies.

Short URL to this thread: https://techguy.org/647033

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice