//
// BankAccount.h
// OC1_银行账户类
//
// Created by zhangxueming on 15/6/10.
// Copyright (c) 2015年 zhangxueming. All rights reserved.
// #import <Foundation/Foundation.h> @interface BankAccount : NSObject
{
NSString *_account;
NSString *_password;
float _money;
int _year;
} //构造方法
- (id)initWithAccount:(NSString *)account andPassword:(NSString *)password; //setter方法
- (void)setAccount:(NSString *)aAccount;
- (void)setPassword:(NSString *)aPassword;
- (void)setYear:(int)aYear;
- (void)setAccount:(NSString *)aAccount andPassword:(NSString *)aPassword; //getter方法
- (NSString *)account;
- (NSString *)password;
- (float)money;
- (int)year; //存款
- (float)saveMoney:(float)aMoney; //取款
- (float)getMoney:(float)aMoney; @end
//
// BankAccount.m
// OC1_银行账户类
//
// Created by zhangxueming on 15/6/10.
// Copyright (c) 2015年 zhangxueming. All rights reserved.
// #import "BankAccount.h" @implementation BankAccount //构造方法
- (id)initWithAccount:(NSString *)account andPassword:(NSString *)password
{
if (self = [super init]) {
_account = account;
_password = password;
}
return self;
} //setter方法
- (void)setAccount:(NSString *)aAccount
{
_account = aAccount;
}
- (void)setPassword:(NSString *)aPassword
{
_password = aPassword;
}
- (void)setYear:(int)aYear
{
_year = aYear;
}
- (void)setAccount:(NSString *)aAccount andPassword:(NSString *)aPassword
{
_account = aAccount;
_password = aPassword;
} //getter方法
- (NSString *)account
{
return _account;
}
- (NSString *)password
{
return _password;
}
- (float)money
{
return _money;
}
- (int)year
{
return _year;
} //存款
- (float)saveMoney:(float)aMoney
{
return _money+=aMoney;
} //取款
- (float)getMoney:(float)aMoney
{
return _money-=aMoney;
} @end
//
// main.m
// OC1_银行账户类
//
// Created by zhangxueming on 15/6/10.
// Copyright (c) 2015年 zhangxueming. All rights reserved.
// #import <Foundation/Foundation.h>
#import "BankAccount.h" int main(int argc, const char * argv[]) {
@autoreleasepool {
BankAccount *bankAccount = [[BankAccount alloc] init];
[bankAccount setAccount:@"" andPassword:@""];
NSLog(@"account = %@ password = %@", [bankAccount account],[bankAccount password]); NSLog(@"money = %.2f", [bankAccount saveMoney:]);
NSLog(@"money = %.2f",[bankAccount getMoney:]);
}
return ;
}

OC1_银行账户类的更多相关文章

  1. 简单练习题2编写Java应用程序。首先定义一个描述银行账户的Account类,包括成员变 量“账号”和“存款余额”,成员方法有“存款”、“取款”和“余额查询”。其次, 编写一个主类,在主类中测试Account类的功能

    编写Java应用程序.首先定义一个描述银行账户的Account类,包括成员变 量“账号”和“存款余额”,成员方法有“存款”.“取款”和“余额查询”.其次, 编写一个主类,在主类中测试Account类的 ...

  2. 银行账户管理系统(oracle数据库连接池,数据库的链接,)

    /* * 银行账户管理系统: * 属性:账户id,姓名,金额salary,利息类型: *管理员模块实现的功能: * 1.给用户开户 * 2.查询所有账户信息 * 用户模块实现的功能: * 1.显示用户 ...

  3. 关于银企直连中银行通信类 配置篇 EPIC_PROC

    简单介绍:SAP银行企业直连,英文全称:Electronic Payment Integration(For China),简称EPIC,是SAP中国为本地化的需求开发的一款产品,以银企直连为支撑,主 ...

  4. FPM-OVP增强实例-银行账户

    本文是基于NWBC银行账户信息进行增强,相关过程如下: 1.定位需要增强的界面 首先登陆SAP-GUI(尽量EN登陆,ZH可能乱码),输入TCODE:NWBC跳转到浏览器界面,新建银行账户: 注意上图 ...

  5. 基于Spring MVC + Spring + MyBatis的【银行账户信息管理系统】

    资源下载:https://download.csdn.net/download/weixin_44893902/45604661 练习点设计: 模糊查询.删除.新增.修改 一.语言和环境 实现语言:J ...

  6. 申请Payoneer美国万事达信用卡,可获得一个美国虚拟银行账户,立即注册可得25美元

    申请Payoneer美国万事达信用卡,可获得一个美国虚拟银行账户,可以在国内任意一个支持万事达的ATM.POS机上取现和刷卡消费.Payoneer可以网上购物,购买国外的产品,对我们有一个好处就是利用 ...

  7. (转)Oracle EBS 有效银行账户取值 银行科目

    SELECT ba.bank_account_id, --银行账户key ftv.territory_short_name, --国家 ftv.territory_code, --国家简称 cb.ba ...

  8. Java实验-课程设计报告一:个人银行账户管理系统SavingAccountManageSystem-具体文档+源码

    课程设计报告一:个人银行账户管理系统 此文档及源码仅供参考 不得直接复制使用 author: [xxxxxxxxx xx xxxx] date: "2019-04-12" 作 者: ...

  9. Oracle EBS 银行账户API

     创建银行 -- Create Bank DECLARE p_init_msg_list VARCHAR2(200); p_country_code VARCHAR2(200); p_bank_nam ...

随机推荐

  1. 射频识别技术漫谈(7)——ID卡【worldsing笔记】

    ID(Identification)是识别的意思,ID卡就是识别卡.ID卡包含范围广泛,只要具有识别功能的卡片都可以叫ID卡,例如条码卡,磁卡都可以是ID卡,我们这儿说的当然是射频识别卡. 射频ID卡 ...

  2. lazyload 图片延迟加载

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/ ...

  3. iOS 9 学习系列:UIStack View (转载)

    作者:Nathan_Bao 地址:http://www.jianshu.com/p/1991e6c2881a 在 iOS9 中,Apple 引入了 UIStackView,他让你的应用可以通过简单的方 ...

  4. linux tomcat自启动设置

    国内私募机构九鼎控股打造APP,来就送 20元现金领取地址:http://jdb.jiudingcapital.com/phone.html内部邀请码:C8E245J (不写邀请码,没有现金送)国内私 ...

  5. .@RequestMapping 使用方法

    1.@RequestMapping  使用方法  SpringMVC中,@RequestMapping用来处理请求,比方XXX.do @RequestMapping("/aaa") ...

  6. cocos2d 中加入显示文字的三种方式(CCLabelTTF 、CCLabelBMFont 和CCLabelAtlas)

    在 cocos2d 中有三个类能够在层或精灵中加入文字: CCLabelTTF CCLabelBMFont CCLabelAtlas      CCLabelTTF CCLabelTTF 每次调用 s ...

  7. httpclient模拟浏览器訪问站点

    HttpClient 是 Apache Jakarta Common 下的子项目.能够用来提供高效的.最新的.功能丰富的支持 HTTP 协议的client编程工具包.而且它支持 HTTP 协议最新的版 ...

  8. 显示 png 图片

    uses   pngimage;{显示 png 图片}procedure TForm1.Button2Click(Sender: TObject);var  png: TPngImage;begin  ...

  9. Microsoft Visual Studio与Firefly 加载的项目已建议,更新源代码地位问题

    一开始装笔记本vs2010,由于使用的近期发展vs2008与vs2005所以,今天再次2008.2005安装在,但是在打开的项目时,,首先提示加载项目文件.然后已建议状态,非常慢非常慢的,之前仅仅有v ...

  10. Android GridView 添加 网格线解决办法

    在使用 GridView 网格布局时,默认情况下 GridView  是没有网格线的,但是有些时候我们需要让GridView显示分割线,怎么办呢?查了不少资料,找到了一种为GridView添加网格线的 ...