36

taeyoon00_mini2.java

 2 years ago
source link: https://gist.github.com/taeyoon-zero-base-backendschool/7a6861e498a5d34743f64c2dbbe8c09f
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

taeyoon00_mini2.java · GitHub

Instantly share code, notes, and snippets.

import java.util.Scanner;

public class Main { public static void main(String[] args) { System.out.println("[캐시백 계산]"); Scanner sc = new Scanner(System.in); int cash; System.out.print("결제 금액을 입력해주세요. (금액):"); cash = sc.nextInt();

int cashBack = 0; int cashleft = 0;

if (cash < 1000) { cashBack = 0; System.out.printf("결제 금액은 %d원이고, 캐시백은 없습니다.",cash); } else if (cash < 3000) { cashleft = cash/10; String cashleft1 = Integer.toString(cashleft); String cashleft2 = cashleft1.substring(1,3); int cashleft3 = Integer.parseInt(cashleft2); cashBack = cashleft - cashleft3; System.out.printf("결제 금액은 %d원이고, 캐시백은 %d원입니다.",cash , cashBack); } else { System.out.printf("결제 금액은 %d원이고, 캐시백은 300원입니다.",cash); } } }


Recommend

  • 175
    • blog.joegreen.pl 6 years ago
    • Cache

    Lesser–Known Java Syntaxes

    Lesser–Known Java Syntaxes Aug 28, 2017 Even though I’ve been programming in Java for a few years, there are still cases when its syntax...

  • 147
    • www.infoq.com 6 years ago
    • Cache

    期待已久的Java 9 今日发布

    期待已久的Java 9 今日发布-InfoQ

  • 126

    With each successive version of Java, frameworks must adapt and transform in order to stay current. This article aims to describe some of the new Java 8 features in Eclipse Collections, a high performance collections framework for Java, and look...

  • 93

  • 184

    Evaluate How Java EE Security and MVC 1.0 simplify Java microservices ...

  • 154
    • www.falkhausen.de 6 years ago
    • Cache

    Java&nbsp;9

    Java 10

  • 200
    • 掘金 juejin.im 6 years ago
    • Cache

    Java高并发综合

    这篇文章是研一刚入学时写的,今天整理草稿时才被我挖出来。当时混混沌沌的面试,记下来了一些并发的面试问题,很多还没有回答。到现在也学习了不少并发的知识,回过头来看这些问题和当时整理的答案,漏洞百出又十分可笑。发表出来权当对自己的一个提醒——如果不能...

  • 7
    • felixxiong.github.io 3 years ago
    • Cache

    iPad mini2降级iOS10.3.3

    我的iPad mini2由于更新到12.4后卡顿,犹豫前后终于进行降级操作。 按照威锋网的一个帖子进行操作,本帖为我的踩坑贴汇总。 安装环境报错 使用pip3 install -r requirements.txt进行安装 bsdiff4 (

  • 3

    Cubot just launched their new 4-inch compact KingKong Mini2 Pro

  • 8

    And we finally have something for the compact phone lovers. Most of the phone brands are not giving them enough love, but there are some exceptions. Like KingKong Mini2 Pro...

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK