A few days ago
kesuma_dewi87

C programming help needed?

My lecturer gave me an assignment bout “The Personal Expenditure Record Book” where user can add data,edit,search,list and delete the data. The program also can calculate the user expenses per month. For a student like me this assignment really high level. And I really2 need help from the master of C programming

Top 1 Answers
A few days ago
Anonymous

Favorite Answer

This is a non-trivial assignment if you have to write it from scratch in C. What development environment are you using?? How long were you given to to the assignment?? Does it have to save entered data between runs (like a real progam) ??

Ok this stuff isn’t all that hard. It just has a number of different types of tasks. You can allocate one to each person.

1) You have to design a structure that will hold the record

2) You have to have a routine that uses ‘sprintf’ and ‘scanf’ to put the record into a string (and put the string back into a record) that can be saved to a text file, one record per line.

3) You have to have a way of putting menus on the screen and prompting the user to enter a selection

4) You have to be able to prompt for additional information (eg a search string) when processing a menu request

5) You have to have a screen that allows you to list the records and be able to select them for deletion or editing

6) You have to have a screen that prompts for the record information and stores it in the C-structure.

When it starts up, it will open the datafile and populate an array of record structures. When you exit the program, it will write the current content of the array back to a data file.

Altogether it is quite a lot of work. But each module should be something that one person can do in a couple of hours, depending what amount of C that they know.

Focus first on the core functions, and then add the less important ones later. eg you need a menu system and a way to get data from the user and store it in an array of structures, and list them back to the screen. editing/deleting/searching/saving to a file can all come later.

Good luck!

0