⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 selfservice.java

📁 java编程代码
💻 JAVA
字号:

import java.util.Scanner;

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

        System.out.println("Enter number of items purchased");
        System.out.println("followed by the cost of one items.");
        System.out.println("Do not use a dollar sign.");

        int count = keyboard.nextInt( );
        double price = keyboard.nextDouble( );
        double total = count*price;

        System.out.printf("%d items at $%.2f each.%n", count, price);
        System.out.printf("Total amount due $%.2f.%n", total);

        System.out.println("Please take your merchandise.");
        System.out.printf("Place $%.2f in an envelope %n", total);
        System.out.println("and slide it under the office door.");
        System.out.println("Thank you for using the self-service line.");
    }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -