zoukankan      html  css  js  c++  java
  • Java编程语言基础 第三章 我行我素换购

    package cn.save;

    import java.util.Scanner;

    public class Myshop {
    public static void main(String[] args) {
    System.out.println(" " + "欢迎使用我行我素购物管理系统");
    Scanner input = new Scanner(System.in);
    System.out.println(" " + "1.登录系统" + " " + " " + "2.退出");
    System.out.println("*******************************************");
    int num = input.nextInt();

    switch (num) {
    case 1:
    System.out.println(" " + "1.客户信息管理");
    System.out.println(" " + "2.购物结算");
    System.out.println(" " + "3.真情回馈");
    System.out.println(" " + "4.注销");
    int num1 = input.nextInt();
    switch (num1) {
    case 1:
    System.out.println("购物系统>客户信息管理");
    System.out.println(" " + "1.显示所有客户信息");
    System.out.println(" " + "2.添加客户信息");
    System.out.println(" " + "3.修改客户信息");
    System.out.println(" " + "4.查询客户信息");
    break;
    case 3:
    System.out.println("购物管理系统>真情回馈");
    System.out.println(" " + "1.幸运大放送");
    System.out.println(" " + "2.幸运抽奖");
    System.out.println(" " + "3.生日问候");
    // System.out.println(" "+"4.换购优惠");

    System.out.print("请输入消费金额:");
    double je = input.nextDouble();
    System.out.print("是否参加优惠换购活:");
    String num2 = input.next();
    System.out.println(num2);

    if (num2.equals("是")) {
    if (je >= 200) {
    System.out
    .print("换购 百事 1 500ml可乐 2 5kg面粉 3 苏泊尔菜锅 4 欧莱雅爽肤水 5 ");
    int num3 = input.nextInt();
    switch (num3) {
    case 1:
    System.out.println("本次消费总金额:" + (je+2));
    System.out.println("成功换购百事可乐饮料1瓶");
    break;
    case 2:
    System.out.println("本次消费总金额:" + (je+3));
    System.out.println("成功换购500ml可乐1瓶");
    break;
    case 3:
    System.out.println("本次消费总金额:" + (je+10));
    System.out.println("成功换购5kg面粉");
    break;
    case 4:
    System.out.println("本次消费总金额:" + (je+10));
    System.out.println("成功换购苏泊尔菜锅一个");
    break;
    case 5:
    System.out.println("本次消费总金额:" + (je+20));
    System.out.println("成功换购欧莱雅爽肤水一瓶");
    break;
    }
    } else if (200 > je & je >= 100) {
    System.out
    .print("换购 百事 1 500ml可乐 2 5kg面粉 3 苏泊尔菜锅 4 欧莱雅爽肤水 5 ");
    int num4 = input.nextInt();
    switch (num4) {
    case 1:
    System.out.println("本次消费总金额:" + (je+2));
    System.out.println("成功换购百事可乐饮料1瓶");
    break;
    case 2:
    System.out.println("本次消费总金额:" + (je+3));
    System.out.println("成功换购500ml可乐1瓶");
    break;
    case 3:
    System.out.println("本次消费总金额:" + (je+10));
    System.out.println("成功换购5kg面粉");
    break;
    }
    } else if (100 > je & je >= 50) {
    System.out.println("本次消费总金额:" + (je+2));
    System.out.println("成功换购百事可乐饮料1瓶");
    }

    else {
    System.out.println("本次消费总金额:" + (je+0));
    System.out.println("欢迎下次光临");
    }
    }

    }
    break;
    case 2:
    System.out.println("欢迎下次光临");
    break;
    default:
    System.out.println("输入错误");

    }
    }
    }

  • 相关阅读:
    (05)ElasticSearch 倒排索引
    (04)ElasticSearch 安装Kibana
    (03)ElasticSearch 安装ElasticSearch-Head插件
    (02)ElasticSearch 安装
    (004)Linux http命令curl访问url
    (01)ElasticSearch概述
    (16)mongodb mapReduce分布式统计示例遇到的一个未解问题,求平均值不对,希望哪位大神给指点一下
    (15)mongodb mapReduce的概念及用法
    (14)mongodb aggregate聚集框架
    CodeForces
  • 原文地址:https://www.cnblogs.com/ls1783047205/p/9336729.html
Copyright © 2011-2022 走看看