商品库存清单案例(Java)

商品库存清单案例(Java)

public class Shop {
    //商品信息
    String type;//商品类型
    double size;//商品大小
    double price;//商品价格
    int number;//商品数量

    public static void main(String[] args) {
        double count1;
        double count2;
        System.out.println("*************************商城库存清单***********************");

        System.out.println("品牌型号                        尺寸                           价格                                  库存数");

        String style = "YSL";
        double size = 13.5;
        double price = 35264.0;
        int number = 45;

        String style2 = "TF";
        double size2 = 15.5;
        double price2 = 352.0;
        int number2 = 2;

        count1 = number +number2;
        count2 = price + price2; 

        System.out.println(style+"          "+size+"        "+price+"       "+number);
        System.out.println(style2+"          "+size2+"        "+price2+"       "+number2);

        System.out.println("********************************************************");

        System.out.println("总库存数:  "+count1);  
        System.out.println("库存商品总金额:  "+count2);

    }

}

控制台打印信息
这里写图片描述

猜你喜欢

转载自blog.csdn.net/tangweiee/article/details/78612476
今日推荐