Purchase Solution

C program to sort the client data on various fields

Not what you're looking for?

Ask Custom Question

Write a C program that prompts the user to enter data regarding some clients.

The user should be prompted for client account number (a UNIQUE positive integer between 1 and 1000), a name (a string, up to 25 in length), and the account balance (a positive floating point number) for each client. The user input terminates once the user enters a -999 as the account number.

Store this client information in an array of type struct (something). Make the array sizes large enough to hold data for up to 25 clients.

Once the user has completed entering the data, the program should then SORT THE DATA IN ASCENDING ORDER BY ACCOUNT NUMBER, OR NAME OR BALANCE, and output the client data in table form.

Please refer to the attached document (P5.docx) for exact details.

Attachments
Purchase this Solution

Solution Summary

Code does thorough input validation in most places (though it is assumed that user will supply correct input), and makes use of function pointers and qsort function from standard C library, for sorting the data on various structure fields.

Solution Preview

Attached 306677.c has been tested for warning and error free compilation via "gcc -Wall 306677.c". It has ...

Purchase this Solution


Free BrainMass Quizzes
Inserting and deleting in a linked list

This quiz tests your understanding of how to insert and delete elements in a linked list. Understanding of the use of linked lists, and the related performance aspects, is an important fundamental skill of computer science data structures.

Basic Networking Questions

This quiz consists of some basic networking questions.

Excel Introductory Quiz

This quiz tests your knowledge of basics of MS-Excel.

Basic UNIX commands

Use this quiz to check your knowledge of a few common UNIX commands. The quiz covers some of the most essential UNIX commands and their basic usage. If you can pass this quiz then you are clearly on your way to becoming an effective UNIX command line user.

Word 2010: Table of Contents

Ever wondered where a Table of Contents in a Word document comes from? Maybe you need a refresher on the topic? This quiz will remind you of the keywords and options used when working with a T.O.C. in Word 2010.