Hello Malusek,
You
say that what you're having trouble with is
the syntax for creating an account and displaying the operations of the account.
There is no specific syntax in C language for creating accounts or displaying operations on an account, as it is a general-purpose language, not specifically designed for creating banking applications. You need to program all of this using the capabilities offered by the C language.
If you have started programming something and are stuck on an error or something, please post your code and explain what you're struggling with, as the purpose of the forum is not to do the exercise for you.
However, in this kind of project, coding does not come first, and if you don't know where to start, it might be because you're not starting from the beginning.
A good starting point is to reason with respect to the data of the domain you are dealing with, then think about the appropriate data structure, and then code.
In this type of application, data is central.
Thus, even if you provide little information about your project topic, we can understand that:
- you are creating software for a "bank"
- a bank can manage several "clients"
- clients can have several "accounts" in this bank
- each account receives "operations" of debit or credit
- ...
Then, question yourself about the relationships between these different concepts and the actions that will implement them, which will lead you to the functionalities (which must at least contain what is displayed by the menu), and then to the code. You will definitely need to use variables, arrays, and/or linked lists (these are examples of simple data structures, it’s up to you to decide), include structs, manage memory (both volatile and persistent), ...
A real application would also handle clients of several types (business, personal), accounts of several types (checking, savings, life insurance, etc.), operations of several types (cash movements, transfers, credit card, etc.), ...
Since what you're doing looks like an exercise, and not a real development, you should also ask where you stop your level of complexity or realism (ask your teacher when in doubt), or decide where you set the limits (if you have that option) and write it in your design and usage documentation.
Otherwise, to create linked lists and iterate through such a list to display the elements, there are many sites with code examples.
For example, on CCM, we talk about it here, for examples of singly linked lists that are more or less complete:
https://forums.commentcamarche.net/forum/affich-35337296-liste-chainee#9 https://forums.commentcamarche.net/forum/affich-37604397-liste-simplement-chainee https://forums.commentcamarche.net/forum/affich-37604399-liste-doublement-chainee Otherwise, to make it even simpler, if you don't need to manage insertions/removals of elements, you could just use dynamic arrays and manage your data by declaring a pointer to struct, and allocating an initial memory capacity for n elements with alloc, and increasing the capacity with realloc when you approach the limit. Then, you move from one struct to another using the indexing operator
[ ]
, and traversing the data comes down to going through the successive indices of the array.
Dal