python for android : 贷款等额本息每月还款额计算
来源:互联网 发布:阿里云域名不写真名会 编辑:程序博客网 时间:2024/04/29 13:56
dkjs1.py
# -*- coding: utf-8 -*-import androidimport os,sysreload(sys)sys.setdefaultencoding('utf-8')droid = android.Android()# 等额本息 每月还款额计算公式如下:# =(贷款本金*月利率*(1+月利率)^还款月数)/((1+月利率)^还款月数-1)def compute1(): rate= droid.fullQueryDetail("editText1").result["text"] cap = droid.fullQueryDetail("editText2").result["text"] months= droid.fullQueryDetail("editText3").result["text"] print rate,cap,months try: c = float(cap) r = float(rate) m = float(months) if m >360.0: return mhk = (c*(r/1200)*(1+r/1200)**m)/((1+r/1200)**m-1) total = mhk*m print 'total: %.2f' % (total) out = "每月还款额: %.2f元\n还款总利息= %.2f元\n" % (mhk,total-c) droid.fullSetProperty("Text2","text",out) except: droid.makeToast('Error: 输入数字有错误') returndef eventloop(): while True: event=droid.eventWait().result if event["name"]=="click": id=event["data"]["id"] if id=="button1": compute1() if id=="Exit": return elif event["name"]=="screen": if event["data"]=="destroy": returnlayout = """<?xml version="1.0" encoding="utf-8"?><LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/background" android:orientation="vertical" android:layout_width="match_parent" android:layout_height="match_parent" android:background="#ff000000"> <LinearLayout android:id="@+id/linearLayout1" android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="horizontal"> <Button android:id="@+id/Exit" android:layout_width="60dip" android:layout_height="wrap_content" android:text="退出" /> <Button android:id="@+id/button1" android:layout_width="140dip" android:layout_height="wrap_content" android:text="等额本息计算" /> <EditText android:id="@+id/editText1" android:layout_width="match_parent" android:layout_height="wrap_content" android:hint="年利率" android:inputType="textPhonetic|number"> <requestFocus></requestFocus> </EditText> </LinearLayout> <LinearLayout android:id="@+id/linearLayout2" android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="horizontal"> <EditText android:id="@+id/editText2" android:layout_width="200dp" android:layout_height="wrap_content" android:hint="贷款本金" android:inputType="number"> </EditText> <EditText android:id="@+id/editText3" android:layout_width="match_parent" android:layout_height="wrap_content" android:hint="期限(月数)" android:inputType="number"> </EditText> </LinearLayout> <ScrollView android:id="@+id/scrollView" android:layout_width="fill_parent" android:layout_height="wrap_content" android:scrollbars="vertical" android:fadingEdge="vertical" > <TextView android:id="@+id/Text2" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_weight="1" android:singleLine="false" android:textSize="16" android:textColor="#004000" android:background="#FFFFF0" android:padding="10dip" android:hint="输出" /> </ScrollView></LinearLayout>"""droid.fullShow(layout)eventloop()droid.fullDismiss()
参考 https://code.google.com/p/android-scripting/wiki/FullScreenUI
0 0
- python for android : 贷款等额本息每月还款额计算
- python for android : 贷款等额本金每月还款额计算
- python for android : 贷款每月还款额计算
- 等额本金贷款和等额本息贷款计算和比较
- 等额本金贷款和等额本息贷款计算和比较
- 等额本息计算公式
- java等额本金、等额本息计算
- 银行业务中贷款算法等额本金等额本息算法程序
- 贷款计算器- 等额本金、等额本息工具类(Java版)
- java 等额本息计算方式
- 国家利息中的等额本息和等额本金计算算法
- 理财等额本息和等额本金计算公式
- BigDecimal用法之计算等额本金和等额本息
- QLExpress计算等本等息、等额本息、等额本金
- BigDecimal用法之计算等额本金和等额本息
- 等额本金、等额本息
- 等额本金和等额本息两种贷款方式的比较
- 北京住房公积金管理中心个人住房公积金 贷款等额均还月还款额参考表
- SQL*Loader使用方法
- poj 2338 Basic
- shell scripts总结
- 這下又弄了一個新的個人網站 masterchan.me
- 在210上做io口模拟串口
- python for android : 贷款等额本息每月还款额计算
- Camtasis和Hippo Animator
- Cracking the coding interview--Q15.2
- 好书 我讲个笑话,你可别哭啊 第十个缪斯(做一个有趣的人) 评论: 我讲个笑话,你可别哭啊
- OpenDaylight研究的一些感受
- 在VMware中安装Ubuntu系统及开发环境搭建(也适合windows系统)
- oracle awr设置与生成
- 沃尔特·欧文·本特利(Walter Owen Bentley)是著名的创始人
- 程序运行时的内存空间分布