Thread: can any1 plz make this assignment

  1. #1
    Registered User
    Join Date
    May 2009
    Posts
    9

    can any1 plz make this assignment

    can any one plz make this assignment for me as i have no idea about programming but i to pass this subject i dont know why.......
    plz
    TSD Laboratory 5
    page 1
    Random File I/O - Abstract Data Types and Modules
    Aims:
    • Understand and implement a non-trivial algorithm.
    • Practice using random file I/O.
    • Further experience using abstract data types (ADTs) and modules in applications.
    • Further practice using arrays and dynamic memory allocation.
    • Experience using the standard C qsort array sorting function.
    • A first encounter with the void pointer and the C function pointer.
    Problem description:
    We will start with an existing binary file
    containing Robot data.
    The aim is to write a new robot data file containing
    the same Robot data from the original file, but randomly
    shuffled.
    Data Shuffling

    The startup material contains the RobotFile case study program examined in lecture module 4.
    Build the RobotFile program using the provided robotFile[robotFile.exe].PRJ Quincy
    project. Using RobotFile.exe, produce a binary file binbots.data containing 2 or 3 extra robots in
    addition to the robots hard-coded into the program source (a total of 7 or 8 robots).
    You will start a new project fileShuffle reusing most of the source files of the RobotFile program,
    including the libUtil.a library. Both the Robot abstract data type and the util library will be re-used
    unchanged. Some of the functions within robotFile.c are also reusable without change.
    It is recommended to create a fileShuffle directory under …/Lab5/ and to copy all source code and
    the newly created data file binbots.data into the new subdirectory.
    2 - Understand The Task:
    The aim is to write the same Robot instances contained in file binbots.data into a new file
    shuflbots.data, but in a random order.
    Randomly shuffling data is a task that involves a lot of processing.
    Here is a common algorithm to shuffle an array of data:
    1. Associate a random integer with each of the elements in the array.
    2. Sort the array based on an (increasing or decreasing) value of the random numbers using an
    efficient array sorting algorithm.
    The array is now randomly shuffled. We will use this algorithm to shuffle the robots.
    To better understand the shuffling algorithm and its implementation in C, refer to the
    Shuffling Problem document on Blackboard.
    TSD Laboratory 5
    page 2
    Steps to the Solution:
    1. Create new ADT DataKey (data and key pair) composed of:
    struct DataKey with two elements:
    data - an integer
    key - an integer.
    Function dk_init() Initialises a DataKey ( a type of function sometimes called a constructor):
    DataKey dk_init(int data);
    It takes the integer data to store into the pair as a parameter, generates a random integer between 0
    and RAND_MAX, and returns a DataKey.
    This constructor can be used the following way to create a DataKey instance conatining integer val:
    DataKey pair1 = dk_init(val);
    Function dk_compare() - to be used by qsort() to sort an array of DataKey pairs:
    int dk_compare(void *dk1, void *dk2);
    Compares the values of the keys at addresses dk1 and dtk2. It returns the integer difference between
    the values of keys at addresses dk1 and dk2. Note that the void * parameters will have to be
    converted to DataKey * types inside the dk_compare() function code.
    The new abstract data type is written in files DataKey.h for the interface (struct declaration and
    function prototypes) and DataKey.c for its implementation (function bodies).
    2. Main program:
    The steps in the main program fileShuffle.c are as follows:
    • Use fseek to seek to end of file and ftell to obtain the size (in bytes) of file binbots.data.
    • Compute the number of Robot instances numRobots in the file by dividing by the size of the
    Robot type.
    • Dynamically create an array of numRobots DataKey elements each containing the array index as
    data, and a random number as key.
    • Sort the DataKey array based on the key values using the C qsort() function. The array indexes
    inside the array are now randomly shuffled. See the hint on using qsort below.
    • In a loop, read the Robot instances from binbots.data one by one, using the shuffled array indexes
    stored in the DataKey array, and save each Robot as it is read, sequentially into file
    shuflbots.data.
    • The robots will be randomly shuffled in the new file.
    • Load and display the contents of both files to demonstrate the effect of file shuffling.
    Although this program remains only a short time in memory, make it a point to free all memory
    allocated by malloc when it is no longer used by the program. Ask your tutor to check your work to
    make sure that there is no potential memory leak.

    Use functions to subdivide the problem and keep all functions small !
    Backup all your work!

    if u think u can do this plz post ya email address ill send the related files......
    plz help me.........................
    thanks

  2. #2
    Registered User
    Join Date
    May 2009
    Posts
    9
    [attach][attach]Attachment 8914[/attach][/attach]



    this r the related files

  3. #3
    spurious conceit MK27's Avatar
    Join Date
    Jul 2008
    Location
    segmentation fault
    Posts
    8,300
    Quote Originally Posted by jean View Post
    can any one plz make this assignment for me as i have no idea about programming but i to pass this subject i dont know why.......
    plz
    This wouldn't have been half as funny without the rest of the post...or the thread.
    Last edited by MK27; 05-13-2009 at 08:20 PM.
    C programming resources:
    GNU C Function and Macro Index -- glibc reference manual
    The C Book -- nice online learner guide
    Current ISO draft standard
    CCAN -- new CPAN like open source library repository
    3 (different) GNU debugger tutorials: #1 -- #2 -- #3
    cpwiki -- our wiki on sourceforge

  4. #4
    Registered User
    Join Date
    May 2009
    Posts
    9
    hey MK_27 can u help me with it i can mail u n xplain in detail
    plz i really need help

  5. #5
    Banned ಠ_ಠ's Avatar
    Join Date
    Mar 2009
    Posts
    687
    I'll do it, just give me some time because I'm working on a small project right now (shouldn't take too long)

    just pm me all the details
    Last edited by ಠ_ಠ; 05-13-2009 at 08:27 PM.
    ╔╗╔══╦╗
    ║║║╔╗║║
    ║╚╣╚╝║╚╗
    ╚═╩══╩═╝

  6. #6
    Registered User
    Join Date
    May 2009
    Posts
    9
    due to the limitations of the forums i can't post all the files
    can u plz give me ur email id

    thanks

  7. #7
    Banned ಠ_ಠ's Avatar
    Join Date
    Mar 2009
    Posts
    687
    Quote Originally Posted by jean View Post
    due to the limitations of the forums i can't post all the files
    can u plz give me ur email id

    thanks
    pm me the contents of the files
    ╔╗╔══╦╗
    ║║║╔╗║║
    ║╚╣╚╝║╚╗
    ╚═╩══╩═╝

  8. #8
    Registered User
    Join Date
    May 2009
    Posts
    9
    am sorry but i can't

    it says
    jean, you do not have permission to access this page. This could be due to one of several reasons:

    1. Your user account may not have sufficient privileges to access this page. Are you trying to edit someone else's post, access administrative features or some other privileged system?
    2. If you are trying to post, the administrator may have disabled your account, or it may be awaiting activation.

  9. #9
    Woof, woof! zacs7's Avatar
    Join Date
    Mar 2007
    Location
    Australia
    Posts
    3,459
    Quote Originally Posted by ಠ_ಠ View Post
    pm me the contents of the files
    I hope you don't actually do the work.

    A. This is how retards enter the working world.
    B. This is how retards graduate.
    C. This is how we end up working with retards. In so called "Teams".

    Secondly, I hope you fail . I certainly wouldn't hope you pass if you don't know anything about programming, and obviously have no desire to learn.

    Oh, and thirdly, see the rules.

  10. #10
    Banned ಠ_ಠ's Avatar
    Join Date
    Mar 2009
    Posts
    687
    Quote Originally Posted by jean View Post
    am sorry but i can't

    it says
    jean, you do not have permission to access this page. This could be due to one of several reasons:

    1. Your user account may not have sufficient privileges to access this page. Are you trying to edit someone else's post, access administrative features or some other privileged system?
    2. If you are trying to post, the administrator may have disabled your account, or it may be awaiting activation.
    you now have 5 posts, that should get you access
    ╔╗╔══╦╗
    ║║║╔╗║║
    ║╚╣╚╝║╚╗
    ╚═╩══╩═╝

  11. #11
    Registered User
    Join Date
    May 2009
    Posts
    9
    oh ya
    u r rite but only if i was doin some IT course
    am not into any IT or engineering field
    this is just an optional subject i have taken by mistake n now i have to pass it
    n as far as failing is concern i have already failed twice in this subject
    this is the third time am doing it n am sick n tired of this now hence am asking for help from ya
    MR. whatever

  12. #12
    Banned ಠ_ಠ's Avatar
    Join Date
    Mar 2009
    Posts
    687
    when is the assignment due btw?
    ╔╗╔══╦╗
    ║║║╔╗║║
    ║╚╣╚╝║╚╗
    ╚═╩══╩═╝

  13. #13
    Registered User
    Join Date
    May 2009
    Posts
    9
    no luck

  14. #14
    Registered User
    Join Date
    May 2009
    Posts
    9
    its due on next friday
    22nd may

  15. #15
    Banned ಠ_ಠ's Avatar
    Join Date
    Mar 2009
    Posts
    687
    copy and paste if it won't let you pm yet
    ╔╗╔══╦╗
    ║║║╔╗║║
    ║╚╣╚╝║╚╗
    ╚═╩══╩═╝

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. trying to make a KenGen ( for a game tool )
    By lonewolfy in forum C# Programming
    Replies: 4
    Last Post: 03-28-2007, 08:23 AM
  2. need advice/hints for assignment, please help!!
    By dannyrabbittang in forum C Programming
    Replies: 1
    Last Post: 10-22-2006, 01:18 AM
  3. Win32 Common Controls in C++, how do i make and use them?
    By C+noob in forum Windows Programming
    Replies: 6
    Last Post: 01-09-2006, 11:53 AM
  4. want to make this small program...
    By psycho88 in forum C++ Programming
    Replies: 8
    Last Post: 11-30-2005, 02:05 AM
  5. Programming assignment help!
    By GrlNewB in forum C++ Programming
    Replies: 4
    Last Post: 03-13-2003, 09:13 PM