Results 1 to 4 of 4

Thread: C question

  1. #1
    Junior Member
    Join Date
    Feb 2006
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Rep Power
    0

    Default C question

    In this program, you try to simulate some concepts in C++. There are
    several steps. The first step is to implement the quicksort function, which takes an
    abstract array (in the sense that the program does not know what the data type is for the
    elements in the array before running time), the size of the array, and the function to do
    the comparisons between the elements in the array in the sorting. In addition to these
    parameters, quicksort may need some other parameters.
    The general idea is that the abstract array may be implemented as a dynamic twodimension
    array, while the comparison function can be passed into quicksort function
    using a function pointer. You might want to review the class notes and text book (Page
    120) on dynamic two-dimension arrays and function pointers. You can also use
    $man qsort
    to take a look at the library function called qsort.
    The second step is to create a function stringcmp for doing the comparisons between
    ASCII strings and a function intcmp for doing the comparisons between integers.
    The third step is to read data from an input file for students. The format of each student
    record is:
    Student’s First Name:Student’s Last Name:Years in U of L:GPA
    Each line can contain multiple records (separated by *) for several students. For instance,
    the following is a sample of the input file.
    John:Smith:3:3.24*William:Smith:4:3.8*Bill:Clinton :3:2.34
    Jeremy:Hill:4:3.50*Amy:Wood:4:3.90
    Your program has a loop, with each iteration prompting a user to select which column to
    be sorted. The user can choose to sort either on the students’ first names, students’ last
    names, years in U of L or GPAs. The result is displayed on the screen. Since GPAs could
    be floating-point numbers, you also need to create a comparison function (called
    floatcmp) for comparing two such numbers.
    Assume that the user always wants to see the elements in a column to be sorted in the
    ascending order.
    You can assume that there is no error in the input file and there is no error in the
    command-line parameters.
    The format for executing your executable is
    $sorting indata

  2. #2
    Is that all you got? rockdalinux's Avatar
    Join Date
    May 2005
    Location
    Planet Vegeta
    Posts
    987
    Thanks
    27
    Thanked 71 Times in 62 Posts
    Rep Power
    20

    Default

    LOL some one posted his/her homework here
    Rocky Jr.
    What's wrong? I hope I am not making you uncomfortable...

    Never send a boy to do a mans job.

  3. #3
    Junior Member
    Join Date
    Feb 2006
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Rep Power
    0

    Default

    lol Yes,just have no idea with that C porg

  4. #4
    Contributors sweta's Avatar
    Join Date
    Feb 2005
    Location
    New Delhi
    Posts
    225
    Thanks
    20
    Thanked 12 Times in 12 Posts
    Rep Power
    12

    Default

    lol

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. phpmyadmin question
    By paul555 in forum Databases servers
    Replies: 2
    Last Post: 13th July 2007, 09:27 AM
  2. Squid Question
    By asterisk in forum Linux software
    Replies: 2
    Last Post: 17th May 2007, 05:52 PM
  3. C question
    By TOP in forum Coding in General
    Replies: 1
    Last Post: 8th July 2006, 01:14 AM
  4. question
    By TOPHUMAN in forum Shell scripting
    Replies: 1
    Last Post: 6th February 2006, 02:25 PM
  5. Redirecting question
    By sonaikar in forum Linux software
    Replies: 1
    Last Post: 25th June 2005, 01:18 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •