资源简介
简单的存款取款查余额程序。适用于matlab初学者
代码片段和文件信息
% ATM program
%
% Juan Zizumbo
%
% ID# 20533709
clear
load ATMDATA
[nrows ncolumns]= size(record);
IDflag=0;
while IDflag==0
clc
disp(blanks(5)‘); % will display 5 blank spaces with the syntax “blanks(n)“ or 5 blank lines with the syntax “blanks(n)‘ “
message= [blanks(15) ‘Please Enter ID# ---> ‘]; % prompts the user to enter an ID number
IDnumber=input(message); % variable whose value is the ID number
for j=1:nrows
if IDnumber==record{j2} % take the contents of the cell in the second column j row in order to see if the provided IDnumber matches
IDflag=1;
membernumber=j;
name= record{membernumber1}; % where the name is this line takes where the name is from
break % get out of the loop whether finished or not so no more looping has to occur when its found
elseif IDnumber~= record{j2} % If the ID number DOES NOT EQUAL to what is on record
IDflag=3;
end
end
clc
disp(blanks(5)‘)
if IDflag==3 % Will tell you the ID is not correct and ask for it over and over
message =[blanks(15) ‘INCORRECT PIN‘];
disp(message)
pause(2);
IDflag=0;
end
if IDflag==1
message=[blanks(15) ‘Hello ‘ name];
disp(message);
pause(2);
message2=[blanks(15) ‘My What A Lovely Day We Are Having ‘ name];
disp(message2);
message3=[blanks(15) ‘Withdraw is 1 Deposit is 2 Check balance is 3 ---> ‘]; % asks the user what type of transaction they would like to make
trans_type=input(message3); % the transaction type here is for Withdrawal
if (trans_type==1) % WITHDRAW
disp(‘Withdraw‘)
message6= [blanks(15) ‘Checking is 1 Savings is 2 ---> ‘]; % asks if the user would like to withdraw from checking or savings
inquiry=input(message6);
if (inquiry==1) % WITHDRAW from CHECKING
pause(1);
message5= [blanks(15) ‘How much would you like to withdraw from checking? ---> ‘];
amount=input(message5);
amount= -amount
record{j3}(1)= record{j3}(1) + amount
save ATMDATA record;
IDflag=2;
elseif (inquiry==2) % WITHDRAW from SAVING
pause(1);
message7= [blanks(15) ‘How muc
- 上一篇:PreScan罗技方向联合控制仿真教程
- 下一篇:matlab人眼识别代码
相关资源
- matlab人眼识别代码
- LU分解法的matlab实现
- 遗传算法VRP的matlab程序
-
HEV matlab/simuli
nk仿真模型 - kappa系数的MATLAB程序
- 扩展有限元源码
- Matlab基于窗函数的滤波器设计
- 阻尼牛顿法求函数极小值
- 基于遗传算法的排课问题的matlab实现
- 麻省理工matlab公开课课后答案
- MATLAB基于DCT图像压缩
- 人工免疫matlab工具箱
- Matlab三次指数平滑算法
- matlab的qpsk通信仿真
-
低压svg的MATLAB simuli
nk 仿真 - 图像旋转变换(matlab实现)
- L-BFGS的MATLAB代码208770
- 地心坐标系转换为地理坐标系
- 小波边缘检测,matlab程序
- MATLABR2016a从入门到精通素材文件
- 基于MATLAB的gmsk调制解调
- matlab 二维泊松 有限差分法 通过系数
- 大气参数计算MATLAB代码
- 基于灰度共生矩阵的图像分割
- BOC信号跟踪MATLAB仿真代码
- 三次样条差值拟合 matlab
- 基于matlab的模糊控制程序集
- 基于多播的QOSmatlab程序
-
模糊控制的matlab simuli
nk仿真 -
基于Matlab/SIMUli
nk的 OPGW感应取电仿真
评论
共有 条评论