Computer Science Canada Project Need Help!!! Due May 6- Char arrays and sorting |
Author: | simpleerob [ Fri Apr 30, 2004 10:25 am ] | ||
Post subject: | Project Need Help!!! Due May 6- Char arrays and sorting | ||
My compiler is pico ---- .cpp Hi I need help with my term project: I have gotten an out put, but I don't think I formated the program correctly according to the question. If Any one can help me please write back soon, b/c its due thursday May 6th. Here's the question: You have the following clients for your consulting firm: Client -----------------------------------Business Type Acme Construction --------------------Machinery design Johnson Electrical ---------------------Switch manufacturing Brown Heating and Cooling --------- Boiler design Smith Switches -----------------------Switch manufacturing Jones Computers ---------------------Computer sales Williams Cleaning Equipment --------Machinery sales To keep track of your clients in an orderly manner, you need a program that can arrange them alphabetically be name or business type. Write such a program using a bubble sort. The input specifications are to read the client and business from a file. Read the requirement of sorting according to a name or business from the key board. The output specifications is to put the arranged list into an output file. Heres what I have so far:
Here's my results Data items in original order: Client ----------------------------------Business Type Acme Construction -------------------Machinery design Johnson Electrical --------------------Switch manufacturing Brown Heating and Cooling ---------Boiler design Smith Switches -----------------------Switch manufacturing Jones Computers --------------------Computer sales Williams Cleaning Equipment -------Machinery sales Here's my question: I don't understand how to read the data file and sort an array of characters using bubble sort. How can I make an 2 -D array of characters and sort it alphabetically be the name using bubble sort? I don't know if i'm doing the program correctly. I need someone to help me write the program correctly. Please write back soon because its due May 6 th. |