Thread: New Project suggestions helpful

  1. #1
    Registered User
    Join Date
    Apr 2004
    Posts
    15

    New Project suggestions helpful

    The class uses four different makes/models of car: FORD MUSTANG, BMW Z3, NISSAN 350Z, PORSCHE 911.

    * These four cars have ID codes of 1, 2, 3, and 4 respectively. There will never be any other cars.
    * For each of these cars, we need to keep a list of parts that each have 1) a part number, and 2) a part name.
    * The part number will always be an integer ranging from 1 to 500000, and the part name will always be a single word of up to 25 characters.
    * The database for this parts inventory system should be viewed as four linked lists.
    * Write a program that sets up and maintains this database by handling commands to add and delete parts, as well as displaying the parts list for each car.
    * You can refer to the cars by number except when printing out the list.
    * Since we are using linked lists, you should not limit the number of parts for each car that the database can store.
    * You must, however, check for any memory allocation errors.


    just got this lab and would take any suggetions that you are able to help me with. No code is needed. Suggestions at this point would be great.

    thank you

  2. #2
    Slave MadCow257's Avatar
    Join Date
    Jan 2005
    Posts
    735
    What kind of suggestions do you need? The teacher gave pretty straightforward directions for your project and if you know how to do everything it should be real easy.

  3. #3
    Registered User
    Join Date
    Apr 2004
    Posts
    15
    ah sorry

    for instance the link list is pretty much stumping the crap out of me.

    will look more into idea in a moment had to jump in to see if anything yet. thank you for lookin at this btw, MadCow257

  4. #4
    Handy Andy andyhunter's Avatar
    Join Date
    Dec 2004
    Posts
    540
    Here is a linked list explaination I wrote a little bit ago. (Scroll down)

    Additionally here is the site's tutorial on linked lists
    i don't think most standard compilers support programmers with more than 4 red boxes - Misplaced

    It is my sacred duity to stand in the path of the flood of ignorance and blatant stupidity... - quzah

    Such pointless tricks ceased to be interesting or useful when we came down from the trees and started using higher level languages. - Salem

  5. #5
    Slave MadCow257's Avatar
    Join Date
    Jan 2005
    Posts
    735
    I read through this tutorial and I think it should clear up how link lists work, and in turn how they can be implemented for your lab.
    http://richardbowles.tripod.com/cpp/...t/linklist.htm

  6. #6
    End Of Line Hammer's Avatar
    Join Date
    Apr 2002
    Posts
    6,231
    You need blinky
    When all else fails, read the instructions.
    If you're posting code, use code tags: [code] /* insert code here */ [/code]

  7. #7
    Handy Andy andyhunter's Avatar
    Join Date
    Dec 2004
    Posts
    540
    Too much That's it I am bookmarking this.
    i don't think most standard compilers support programmers with more than 4 red boxes - Misplaced

    It is my sacred duity to stand in the path of the flood of ignorance and blatant stupidity... - quzah

    Such pointless tricks ceased to be interesting or useful when we came down from the trees and started using higher level languages. - Salem

  8. #8
    Registered User
    Join Date
    Apr 2004
    Posts
    15
    ok thank you for these replys you are helping me.

    I would like ot know if any of you would mind giving me some example coding on how this program should flow. Better yet, would any of you mind giving me your email? i really wouldn't mind grabbing a tutor to help me 1 on 1 with C++ to better understand this complex language.

    [email protected] if anyone would like to contact me directly on this. Thank you.

  9. #9
    Handy Andy andyhunter's Avatar
    Join Date
    Dec 2004
    Posts
    540
    I would like ot know if any of you would mind giving me some example coding on how this program should flow. Better yet, would any of you mind giving me your email?
    Homework Policy

    Look, you have not done anything for this assignment that you have shown us yet. Its not like this project is the first program you have been required to write.

    Work it out for yourself. Write down how this would work on paper, make some psuedocode. Then go back and start to fill in the psuedocode with real code. When you get stuck at that point come back, show us what you have done, and then ask specific questions, NOT:
    give me some example coding on how this program should flow
    I'll help get you started:
    Code:
    #include <iostream>
    
    using namespace std;
    
    int main() {
    
    //main program flow is down
    
         return 0; // program ends here
    }
    i don't think most standard compilers support programmers with more than 4 red boxes - Misplaced

    It is my sacred duity to stand in the path of the flood of ignorance and blatant stupidity... - quzah

    Such pointless tricks ceased to be interesting or useful when we came down from the trees and started using higher level languages. - Salem

  10. #10
    Registered User
    Join Date
    Apr 2004
    Posts
    15
    Code:
    #include "project1a.h"
    
    int main()
    {
        int temp;
        string temp2;
    
    
        struct Cars  c1, c2, c3, c4;
    
        c1.id = 0;
        c1.next = &c2;
    
        c2.id = 1;
        c2.next = &c3;
    
        c3.id = 2;
        c3.next = &c4;
    
        c4.id = 3;
        c4.next = NULL;
    
        cout << "---------------------------------" << endl;
        cout << "Auto Parts" << endl;
        cout << "---------------------------------" << endl;
        cout << "        Enter Commands Followed by car number (0-3):" << endl;
        cout << "        Add - Add a part" << endl;
        cout << "        Delete - delete a part" << endl;
        cout << "        List - list all parts" << endl;
        cout << "        Quit - end program" << endl;
    
        cin >> temp;
        cin >> temp2;
    
    
        if (temp==0 && temp2=="Add")
        {
            cout << "You entered 0 for car 0, the car we are at is: " << c1.id << endl;
    
            cout << "Please add a part " << endl;
            cin >> c1.name;
        }
    
        for (int count = 0; count<=4;  count++)
        {
    
            cout << c1.id << c1.name << endl;
            cout << c2.id << c2.name << endl;
    
            count = count + 1;
        }
    
    
        return 0;
    }
    so far i've kinda been fooling around this morning with this program.. I think i have the link list up. I've been able to add or access from it. The ending loop, isn't right ( i know this). Just goin to throw this up here for comments.

    how bad is this so far? going the right direction? slowly but surely?

  11. #11
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,656
    Do a search for linked lists - they're a regular topic here, one should meet your needs.

    Your basic approach to constructing the list is OK, but you need to use dynamic memory to allocate each successive node.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Project Help please!
    By black_hole??? in forum C++ Programming
    Replies: 4
    Last Post: 04-28-2009, 12:55 AM
  2. Game Independent Anti-cheat Project Needs Programmers
    By GIA Project Lea in forum Projects and Job Recruitment
    Replies: 3
    Last Post: 09-15-2005, 07:41 PM
  3. project idea ???
    By gemini_shooter in forum C Programming
    Replies: 2
    Last Post: 06-09-2005, 09:56 AM
  4. Current project, suggestions?
    By napkin111 in forum Game Programming
    Replies: 4
    Last Post: 04-08-2003, 08:06 AM