阅读背景:

在java中如何在程序结束时添加(+)用户输入值的所有结果

来源:互联网 

public class TotalHours {

公共课TotalHours {

/**
 * @param args the command line arguments
 */
public static void main(String[] args) {
    double in;
    double out;
    Scanner sc = new Scanner(System.in);

      String choice = "y";
    while (choice.equalsIgnoreCase("y")) {
    System.out.println("Enter Check in time: ");
   in = sc.nextDouble();

            System.out.println("Enter Check out time: ");
            out = sc.nextDouble();
          double calculations;
       calculations = out - in; 
        System.out.println("Total hours of the day: " +calculations);

System.out.print("Calculate another salary? (y/n): ");
        choice = sc.next();
        System.out.println();
/



你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: