sql 语句设置sql sever权限验证
2012-08-10 15:00
246 查看
/*【程序12】 题目:企业发放的奖金根据利润提成。利润(I)低于或等于10万元时,奖金可提10%; 利润高于10万元,低于20万元时,低于10万元的部分按10%提成,高于10万元的部分,可可提成7.5%; 20万到40万之间时,高于20万元的部分,可提成5%; 40万到60万之间时高于40万元的部分,可提成3%; 60万到100万之间时,高于60万元的部分,可提成1.5%, 高于100万元时,超过100万元的部分按1%提成, 从键盘输入当月利润I,求应发放奖金总数? */ package test; import java.io.BufferedReader; import java.io.InputStreamReader; public class test { public static double bonus(double profit) { double result = 0; if (profit <= 100000) result = 0.1 * profit; else { result = 10000; if (profit > 100000 && profit <= 200000) result = result + 0.075 * (profit - 100000); else { result = result + 0.075 * 100000; if (profit > 200000 && profit <= 400000) result = result + 0.05 * (profit - 200000); else { result = result + 0.05 * 200000; if (profit > 400000 && profit <= 600000) result = result + 0.03 * (profit - 400000); else { result = result + 0.03 * 200000; if (profit > 600000 && profit <= 1000000) result = result + 0.015 * (profit - 600000); else { result = result + 0.015 * 400000; if (profit > 1000000) result = result + 0.01 * (profit - 1000000); } } } } } return result; } public static void main(String args[]) { String profit = null; try { BufferedReader br = new BufferedReader(new InputStreamReader( System.in)); System.out.println("请输入当月利润:"); profit = br.readLine(); } catch (Exception e) { } double tempPro = Double.parseDouble(profit); double bonus = bonus(tempPro); System.out.println("本月奖金为: " + bonus); } }这个应该怎么改进呢?
相关文章推荐
- sql语句创建用户、及权限的设置
- 给数据库用户设置存储过程执行权限的SQL语句
- sql语句创建新登录名和设置权限
- MySQL 登录权限设置SQL语句
- Mysql:SQL语句:用户、权限、信息、状态、设置、复制、会话、prepare sql 等
- zencart用sql语句设置默认语言
- 通过SQL语句设置或删除主键
- oracle 设置主键、修改列等sql语句(转载)
- Dbvisualizer设置SQL语句自动提示
- mongodb设置数据库用户,权限,java mongodb driver3.0驱动用户验证
- spring security权限资源管理,数据库sql语句源码
- Oracle:SQL语句--给用户赋权限
- C#中验证sql语句的方法(SET PARSEONLY 与SET NOEXEC )
- SQL语句(二十二)—— 权限授予和回收(作业练习)
- 如何验证 SQL 语句的正确性
- oracle关于权限的一些sql语句
- Access建表SQL语句Create Table设置自动增长列的关键字AUTOINCREMENT使用方法
- SQL Server设置主键自增长列(使用sql语句实现)
- MYBATIS+DB2存储过程验证SQL语句正确性
- Oracle/SQLPlus 相关操作(表空间,用户,权限,字符集等设置)