一周工作40个小时  超过40个小时 一小时工资是平时的1.5倍 输出一周的工作的工资是多少 平时一个小时是4000韩元
要求输出一周的工钱 用java 

解决方案 »

  1.   

    晕!我晕!!我狂晕!!!小学二三年级应用题,你也做不出来啊?难道有什么玄机,比如,一星期里面韩元汇率变了?
    // 如果要精确计算,请换BigDecimal或者统一×100之类。
    double foo(double hour) {
      return (hours <= 40) ? (hours * 4000) : (((hours - 40) * 1.5 + 40) * 4000);
    }
      

  2.   


    double foo(double hour) {
      return (hours <= 40) ? (hours * 4000) : (((hours - 40) * 1.5 + 40) * 4000);
    ……
    [/Quote]
      

  3.   

    、、、、、、、、、、、服you
      

  4.   

    跟HELLO WORLD 有什么区别..哈哈
      

  5.   

    呵呵,确实很基础的问题,用switch也可以嘛~
      

  6.   

    hours <= 40) ? (hours * 4000) : (((hours - 40) * 1.5 + 40) * 4000
      

  7.   

    import java.util.*;
    public class Progrom {
    public static void main(String[] args)
    {
    Scanner input =new Scanner(System.in);
    System.out.print("输入工作时间:");
    double n=input.nextDouble();
    double a=n-40;
    double b=a*6000;
    double c=40*4000;
    double d=b+c;
    System.out.print(d+"韩元");
    }
    }
      

  8.   

    import java.util.*;
    public class Progrom {
    public static void main(String[] args)
    {
    Scanner input =new Scanner(System.in);
    System.out.print("输入工作时间:");
    double n=input.nextDouble();
    double d=0;
    double a=n-40;
    if(a>0)
    {
    double b=a*6000;
    double c=40*4000;
        d=b+c;
    }
    else
    {
       d=n*4000;
    }
    System.out.print(d+"韩元");
    }
    }