help with ADT please

This is a discussion on help with ADT please within the C Programming forums, part of the General Programming Boards category; hi i really need help with an ADT. program to keep track of a real estate company's residential listings. The ...

  1. #1
    Registered User
    Join Date
    Dec 2010
    Posts
    29

    help with ADT please

    hi
    i really need help with an ADT.

    program to keep track of a real estate company's residential listings. The program needs
    to input and keep track of all the listing information, which is stored in a text file. The real estate
    sales people must be able to perform a number of tasks using this data: add or delete a house
    listing, print the information about a specific house. And the search a house by city,. price range,
    and square feet. In addition the program allows buyers to give offers to a desired houses. And
    the owner of the houses can print a list of current offers.
    Let's assume that the house information includes
    ● House ID,
    ● Owner's names,
    ● Street address,
    ● City,
    ● price,
    ● number of square feet,
    ● number of bedrooms.
    ● Year
    Your program must allow the real estates people to
    ● Add a new house listing
    ● Delete a house listing
    ● Print a house information
    ● Search a house listing by
    ● City
    ● Range of price
    ● Range of square feet
    Your program also allows buyers to give offers to their desired houses. The user should enter
    the following information for each offer:
    ● House ID
    ● Buyer's name
    ● Offer price
    Each house should maintain an array of offers. And you can assume that each house will not
    accept more than 5 offers. You should use array lists for this program.



    please this is a big program, i know the homework policy and i don't expect anyone to do my work for me.
    i just need help with
    - an example of how the required data should look like within the text file ( how it should be formatted)
    it asks that the house id, owner name, street address, state and others should be contained within a text file. i have never done this before as generally i always do
    struct House{
    int ID;
    char state[2];
    } you get the idea

    - also if you don't mind how would i write the access, function and modifier functions. i am finding this hard as i would have to do this to the file. if you could please give me a general idea, a rough idea of how my program should look like

    i would really appreciate any help. thanks.

  2. #2
    Registered User
    Join Date
    Mar 2011
    Posts
    53
    i would like to help, but i couldn't understand something: will the user get to read the text file directly, or will the program "translate" it so that the user can read it?

  3. #3
    Registered User
    Join Date
    May 2010
    Posts
    2,889
    How you format your text file is up to you since you are the one designing the format. You could use commas or spaces to separate the individual items of a house or each item go be on it's own line. You may want to look at this link for file i/o.

    Jim

  4. #4
    Registered User
    Join Date
    Nov 2010
    Location
    Long Beach, CA
    Posts
    5,629
    When tackling larger software projects, first you need to understand the problem. Make sure you know exactly what's being asked of you. Then, plan a solution on paper. Write out the data structures you need, what the menu is going to look like, a sample data file, etc. You should spend the bulk of your time coming up with a good design. Then, you start coding in small chunks and test as you go. That last one is super important. It's easy to find a bug in 20 lines, not so easy in 2000 lines. To get you started with some design...

    You will want a struct to represent the house. Since there is a fixed maximum of 5 offers, you should have an array of 5 offers in the house. The rest of the fields should be fairly easy. You may want to dynamically allocate an array to store the house listings so you can sort easily. This will be easier if you store the number of houses at the beginning of your data file.

    First, you should probably make a menu that allows you to pick from all the different things the user can do. Each of those menu choices should correspond to a function: add_house, delete_house, etc. For starters, just make it print out the choice you picked, like "You chose to add a house!" to make sure your menu works.

    Once you have a working menu, you can start filling in the functions with real code. You'll probably want to tackle adding a house and printing listings next, since they're critical to testing everything else. Save stuff like sorting for last. Good luck, and come back if you run into any trouble.

  5. #5
    and the hat of wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,751
    +1 for anduril462's comments.
    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.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Problem with linked list ADT and incomplete structure
    By prawntoast in forum C Programming
    Replies: 1
    Last Post: 04-30-2005, 02:29 AM
  2. Array-based ADT list
    By campermama in forum C++ Programming
    Replies: 0
    Last Post: 06-14-2004, 02:32 PM
  3. half ADT (nested struct) problem...
    By CyC|OpS in forum C Programming
    Replies: 1
    Last Post: 10-26-2002, 09:37 AM
  4. Problem with My Sets ADT
    By jawwadalam in forum C++ Programming
    Replies: 2
    Last Post: 10-04-2002, 07:36 AM
  5. ADT Initialization/Passing of Array from Friended ADT
    By Wiggin in forum C++ Programming
    Replies: 1
    Last Post: 04-27-2002, 01:45 AM

Tags for this Thread


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21