linux c small projects: simulated bank ATM

See the following blog post, I graduated six months, and found that what they learn is quite fragmented, so try to do their own independent small a comprehensive project that will consolidate their knowledge of.

Original link: https: //blog.csdn.net/Robot__Man/article/details/52089923

 

A foreword
path of development programmer:
  layman -> rookie -> Associate Programmer -> Programmer -> core programmer (Advanced) -> System Analyst / System Architect / Project Manager -> Manager / Director (management positions ) -> technical aspects of the CTO president -> engage in their own company

From rookie to the quasi-independent programmers is at least a little to complete their project.

To do the project, the software process:
1 demand (what to write)
2 Systems Analysis (to turn customer requirements into a computer software system)
3 System Design (design of computer software systems)
4 code (the designs implemented in code)
5 test ( software quality assurance, compliance with requirements)
6 installation, commissioning and maintenance

Two simulated bank ATM
2.1 Requirements:
1 must do it yourself, do not write, do not go to copy.
2 to complete as much as possible, I do not know to ask.

2.2 Write a simulated bank ATM cases
  banks include: accounts, sales households, access, withdrawals, transfers, balance inquiries six basic functions, focusing on realization open an account.
Analysis: The
  system includes a server and a client, temporarily do stand-alone version. Client and server data exchange with the message queue, create two message queues: one for the server to the client, one for the client sent to the server.

Server functionality:
create two message queue 1. Start, deleted when closed. , Remove the signal handler signal off.
2. The server according to the data sent by the client, determine what kind of request, and then make corresponding processing according to the various requests.
  Data archived in MSG {struct
    Long MTYPE;
    struct Account ACC;
    };
  struct Account is an account structure types, including members of the account number, user name, password, amount.
3. Analysis of the account opening process.
  Client input user name, password, and the amount the seal in msg data sent to the server through the message queue, the server generates an account, the account information is then written to the file, and returns the processing result to the client.
  Account how to generate? (Guarantee of non-repetition)
  to build an account of the generated files, write the initial value. Every time accounts are the first to read the file, and then read plus one, and as a new account, and then written back to the new account file. Account information is written to the file, a file corresponding to the account to the account + .dat file names do.
4. The server perform various functions with multi-process. (vfork + exec)

Client code:
1. providing selected interface, to select various printing functions.
2. Submit the respective data (using struct msg), and wait for the processing result

 

Guess you like

Origin www.cnblogs.com/cdy0626/p/12481900.html