Arrays and Sorting help

This is a discussion on Arrays and Sorting help within the C Programming forums, part of the General Programming Boards category; Hey there all, can someone please hep me with this question would be greatly appreciated Mr Baker wants to create ...

  1. #1
    Registered User
    Join Date
    Nov 2009
    Posts
    2

    Arrays and Sorting help

    Hey there all,

    can someone please hep me with this question
    would be greatly appreciated

    Mr Baker wants to create an electronic version of his seating chart. Each studentís name will be entered into the seating chart, which will then be output for future reference. He also wants to be able to find and print the row, and the seat within that row, of any given student in the class. Each class has 3 columns and 4 rows of chairs and all chairs have a student assigned to it.

    Discuss how you would!!

    Read the studentsí name and store them in a one-dimensional array.

    Sort the array in descending order.

    Place each student alphabetically in the seating chart in row order from left to right. (Two dimensional array needed).

    Display the finished seating chart

  2. #2
    Registered User
    Join Date
    Oct 2006
    Location
    Canada
    Posts
    1,243
    Discuss how you would!!
    No, discuss how you would!

    Read the students’ name and store them in a one-dimensional array.
    I cant think of a way to give a hint without giving the exact solution. Basically, instead of representing the 3x4 matrix, you just have one long array of 12 elements. For example, where would student at column 2 and row 1 be in this 12-element array?

    Sort the array in descending order.
    By using any sorting algorithm?

    Place each student alphabetically in the seating chart in row order from left to right. (Two dimensional array needed).
    After you have a sorted 1-d array you create a higher dimensional array from it, linearly.

    Display the finished seating chart
    Straightforward.

    So, what was your attempt again?

  3. #3
    Registered User
    Join Date
    Sep 2006
    Posts
    8,868
    It's important for you to bring your own attempt at this, to the forum. We neither want to do it for you, nor eliminate the learning you'll achieve by working on it.

    So post up your good attempt at this, and be prepared to ask specific questions about it, that are giving you trouble.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 26
    Last Post: 06-11-2009, 11:27 AM
  2. Sorting Arrays
    By DaniiChris in forum C Programming
    Replies: 11
    Last Post: 08-03-2008, 08:23 PM
  3. Replies: 16
    Last Post: 01-01-2008, 03:07 PM
  4. Replies: 2
    Last Post: 02-23-2004, 05:34 AM
  5. sorting arrays
    By Unregistered in forum C++ Programming
    Replies: 3
    Last Post: 10-13-2001, 05:39 PM

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