import java.util.Scanner;
public class Rate {
public static void main(String[] args){
Scanner input = new Scanner(System.in);
System.out.println("Enter the subtotal and a gratuity rate:");
double sub = input.nextDouble();
double rate = input.nextDouble();
double gra = sub*rate*0.01;
double total = gra+sub;
System.out.println("The gratuity is $" + gra + " and total is $" + total);
}
}

Exercise02_05的更多相关文章

随机推荐

  1. URAL - 1486 Equal Squares 二维哈希+二分

    During a discussion of problems at the Petrozavodsk Training Camp, Vova and Sasha argued about who o ...

  2. photo@PKU

  3. hihoCoder 1527 快速乘法

    #include<bits/stdc++.h> using namespace std; ; char a[N]; int main() { scanf(); ); ,r = n; ') ...

  4. noip2016 提高组

    T1 玩具谜题 题目传送门 这道题直接模拟就好了哇 233 #include<cstdio> #include<cstring> #include<algorithm&g ...

  5. 【Python实例一】使用minidom读取xml文件

    前言:最近刚在廖雪峰老师的网站里学习了Python的基础内容,想着循序渐进地找点实例练练手,网上看到有很多相关资料,决定针对感兴趣的内容实际编码实践一下,昨天刚好看到有关使用Python来读取XML文 ...

  6. Linux音频编程

    1. 背景 在<Jasper语音助理介绍>中, 介绍了Linux音频系统, 本文主要介绍了Linux下音频编程相关内容. 音频编程主要包括播放(Playback)和录制(Record), ...

  7. String类的常见方法的使用案例

    String类的常见方法的使用案例 //使用指定的字符串替换当前字符串中指定的内容 //将helloworld中的o替换为a String s="HelloWorld"; Stri ...

  8. 关于background

    background目前有size;  color;  image;  repeat;position;attachtment; 作用分别是一:调整背景大小. 语法:background-size:a ...

  9. MYSQL使用外键进行优化

    #转载请联系 假如你是京东的数据库管理员,你现在管理着这样一个数据库. mysql> select * from goods; +----+--------------------------- ...

  10. [设计模式-行为型]状态模式(State)

    一句话 在一个类的对象中维护状态的类的对象 概括