| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 481 人关注过本帖
标题:新手遇到JAVA难题了。求帮助。谢谢了
只看楼主 加入收藏
williamsky
Rank: 1
等 级:新手上路
帖 子:1
专家分:0
注 册:2015-7-1
收藏
 问题点数:0 回复次数:0 
新手遇到JAVA难题了。求帮助。谢谢了
图片附件: 游客没有浏览图片的权限,请 登录注册
图片附件: 游客没有浏览图片的权限,请 登录注册

关键如何把不同的区间要求体现出来。同时怎嘛才能把算productivity score的公式 表现出来。谢谢啦
程序代码:
// EmployeeBonus.java - This program calculates an employee's productivity bonus. 

import javax.swing.*;

public class EmployeeBonus 
{
public static void main(String args[])
{
// Declare and initialize variables here.
String employeeName; 
double numTransactions; 
String transactString;
double numShifts; 
String shiftString;
double dollarValue;
String dollarString;
        double score;
double bonus;
final double BONUS_1 = 25.00;
final double BONUS_2 = 50.00;
final double BONUS_3 = 100.00; 
final double BONUS_4 = 200.00;


// This is the work done in the housekeeping() method
                employeeName = JOptionPane.showInputDialog("Enter employee's name: ");
shiftString = JOptionPane.showInputDialog("Enter number of shifts: ");
transactString = JOptionPane.showInputDialog("Enter number of transactions: ");
dollarString = JOptionPane.showInputDialog("Enter transactions dollar value: ");

numShifts = Double.parseDouble(shiftString);
numTransactions = Double.parseDouble(transactString);
dollarValue = Double.parseDouble(dollarString);
// This is the work done in the detailLoop() method
if(score<=30)
bonus=Bonus_1;
else if(score<=79 && score>=31)
bonus=Bonus_2;
else if(score<=199 && score>=80)
bonus=Bonus_3;
else
bonus=Bonus_4
// Write your code here

// This is the work done in the endOfJob() method    
// Output.  
System.out.println("Employee Name: " + employeeName);
System.out.println("Employee Bonus: $" + bonus);

System.exit(0);
}
}     
搜索更多相关主题的帖子: import JAVA 如何 
2015-07-01 11:50
快速回复:新手遇到JAVA难题了。求帮助。谢谢了
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.012866 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved