阅读背景:

薪资计划第2部分(运行时出问题)

来源:互联网 
// Week 3 Checkpoint1: Payroll Program Part 2
// Due May 04, 2012
// Created by: Kennith Adkins

import java.util.Scanner;

public class Assignment1
 {
    public static void main ( String[] args )
    {
        Scanner input = new Scanner(System.in);

        // Variables
        String employeeName = null;
        int hours;
        double rate;
        double pay;

        while ( employeeName != "stop")
        {
        // Request information from user
        System.out.print ( "Employee Name: ");
        employeeName = input.nextLine();
        System.out.print ( "Hourly Rate: ");
        rate = input.nextDouble();
        System.out.print ( "Number of Hours worked this week: ");
        hours = input.nextInt();

        // Calculate pay
        pay = rate * hours;

        // Display information
        System.out.printf ("%s will get paid $%.2f this week.\n", employeeName, pay);


        }
    }
}
// Week 3 Checkpoint1: Payroll Program Part 2
/



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

分享到: