task : Simulated bank ATM machine , Friendly interface is required
First, we analyze this problem :
* simulation ATM machine , Realize the following functions :1. Check the balance 2. deposit 3. withdraw money 0. sign out ( Lump sum deposit and withdrawal required )
* Friendly interface is required .
system design :
* Module differentiation , Determine the function and input of each module / output
* 1.showMenu modular
* function : Display menu function , Read the user's operating system
* input : nothing
* output : Returns the function selection entered by the user
* 2.getMoney modular
* function : Query the balance of user account .
* input : nothing
* output : Return the balance of user account
* 3.deposit( storage ) modular
* function : Increase the account balance according to the amount of money entered by the user
* input : Amount to be deposited
* output : nothing
* 4.withdraw modular
* function : Reduce the balance according to the amount of money entered by the user , If the balance is not enough, you will be prompted that this operation cannot be completed .
* input : Amount to be withdrawn .
* output : nothing
Code display :
Header file .h
#include<stdio.h> #include<stdlib.h> // Function declaration int showMenu(); double getMoney();
void deposit(double temp); void withdraw(double temp);
Block part :.c
Technology