当前位置: 首页 > news >正文

顺义的网站建设公司网创项目资源网站

顺义的网站建设公司,网创项目资源网站,电子商务网站概要设计,怎么做网站赚钱的动漫网站1、概述 源码放在文章末尾 该项目实现了用于存款和贷款的计算器的功能&#xff0c;如下图所示&#xff1a; 项目部分代码如下&#xff1a; #ifndef WIDGET_H #define WIDGET_H#include <QWidget>namespace Ui { class Widget; }class Widget : public QWidget {Q_OBJ…

1、概述
源码放在文章末尾

该项目实现了用于存款和贷款的计算器的功能,如下图所示:
在这里插入图片描述

项目部分代码如下:

#ifndef WIDGET_H
#define WIDGET_H#include <QWidget>namespace Ui {
class Widget;
}class Widget : public QWidget
{Q_OBJECTpublic:explicit Widget(QWidget *parent = 0);~Widget();private:Ui::Widget *ui;private slots:void initForm();void on_btnCalc_clicked();void on_btnCalc2_clicked();
};#endif // WIDGET_H
#pragma execution_character_set("utf-8")#include "widget.h"
#include "ui_widget.h"
#include "qmessagebox.h"
#include "qdebug.h"Widget::Widget(QWidget *parent) : QWidget(parent), ui(new Ui::Widget)
{ui->setupUi(this);this->initForm();
}Widget::~Widget()
{delete ui;
}void Widget::initForm()
{QDateTime now = QDateTime::currentDateTime();ui->dateStart->setDate(now.date());ui->dateEnd->setDate(now.date().addYears(1));
}void Widget::on_btnCalc_clicked()
{//当前多少钱int moneyCurrent = ui->txtMoneyCurrent->text().toInt();//利息float rate = ui->txtRate->text().toFloat();//定期期限int year = ui->cboxYear->currentText().left(1).toInt();//总年份 必须是定期期限的倍数int years = ui->txtYears->text().toInt();//最终多少钱int moneyAll = 0;if (years % year != 0) {ui->txtYears->setFocus();QMessageBox::critical(this, "错误", "总年份必须是期限的整数倍数!");return;}if (ui->cboxType->currentIndex() == 0) {//傻瓜场景 直接计算moneyAll = moneyCurrent + (moneyCurrent * rate * years);} else {//真实场景 复利计算int count = years / year;for (int i = 0; i < count; ++i) {moneyCurrent = moneyCurrent + (moneyCurrent * rate * year);}moneyAll = moneyCurrent;}//计算下来3年期定期存款30年总金额翻2番到最初本金3倍 100W本金3年期自动续期30年=321WQString value = QString::number(moneyAll);ui->txtMoneyAll->setText(value);//拷贝到其他地方if (ui->rbtn1->isChecked()) {ui->txtValue1->setText(value);} else {ui->txtValue2->setText(value);}//计算两种存款方式的差额 比如1年期存3年和3年期存3年QString value1 = ui->txtValue1->text().trimmed();QString value2 = ui->txtValue2->text().trimmed();if (!value1.isEmpty() && !value2.isEmpty()) {int value = qAbs(value1.toInt() - value2.toInt());ui->txtValue->setText(QString::number(value));}
}void Widget::on_btnCalc2_clicked()
{//计算天数QDateTime dateStart = ui->dateStart->dateTime();QDateTime dateEnd = ui->dateEnd->dateTime();int day = dateStart.daysTo(dateEnd);int money = ui->txtMoney2->text().toInt();float rate = ui->txtRate2->text().toFloat();int result = money * rate * day;ui->txtResult2->setText(QString::number(result));qDebug() << day;
}

源码下载

http://www.yayakq.cn/news/89149/

相关文章:

  • 网站后期维护是做什么物流如何做网站
  • 国际网站建站模板软件app
  • 网站备案核验单清晰室内设计公司的运营模式
  • 长春火车站到龙嘉机场高铁时刻表wordpress+获得子类id
  • 济南外贸网站响应式布局什么意思
  • 帮人做推广的网站企业门户下载
  • 网站后台数字排版该怎么做黄冈app下载推广介绍
  • wordpress著名网站wordpress实现双语
  • mip网站案例wordpress首页怎么设置
  • 做网盘搜索网站合法吗福田区罗湖区宝安区龙华区
  • 绵阳网站关键词做美图 网站有哪些
  • wordpress快站seo引擎优化软件
  • 国外可以做推广的网站门户网站内容建设
  • app软件网站建设如何查询logo是否已经被注册
  • 做网站是什么课网站空间模板
  • 口碑好网站建设价格wordpress填表
  • 专做定制旅游网站有哪些北京优化核酸检测
  • 网站建设头部代码网站备案需要当面核验哪些信息
  • 如何做汽车的创意视频网站设计个人网站免费搭建
  • 湖北民族建设集团网站实木复合门网站建设价格
  • 网站上的产品板块手机网站缩放
  • 网站搭建哪里找方便wordpress paypal
  • app 网站企业管理软件销售好做吗
  • 网站建设进度西瓜网络深圳网站建设 东莞网站建设
  • 现在如何给网站做外链wordpress主题模板Git下载
  • 设计师网站prinest山东响应式网站建设
  • 哪里有.net电子商务网站开发教程深圳网站排名怎么做
  • 网站建设最便宜多少钱广州企业网站建设公司哪家好
  • 服务器建网站教程白云区住房和建设水务局网站
  • 高大模板相关信息圆柱钢模板优势是什么?企业网站建设模板和定制化有什么区别呢?支架检查重点?山东德铭工程建设公司网站