import java.util.Scanner;

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

         System.out.print("Enter the subtotal and a gratuity rate: ");

         double subtotal = input.nextDouble();
         double gratuityRate = input.nextDouble();

         double gratuity = subtotal * gratuityRate / 100.0;
         double total = subtotal + gratuity;

         System.out.println("The gratuity is " + gratuity + " and total is " + total);

         input.close();
     }
 }

HW2.5的更多相关文章

  1. JAVA HW2

    MODEL //yuec2 Yue Cheng package hw2; import java.io.File; import java.io.FileNotFoundException; impo ...

  2. Software Testing hw2

    Fault的定义:可能导致系统或功能失效的异常条件(Abnormal condition that can cause an element or an item tofail.),可译为“故障”. ...

  3. HW2.25

    import java.util.Scanner; public class Solution { public static void main(String[] args) { Scanner i ...

  4. HW2.24

    import java.util.Scanner; public class Solution { public static void main(String[] args) { Scanner i ...

  5. HW2.23

    import java.util.Scanner; public class Solution { public static void main(String[] args) { Scanner i ...

  6. HW2.22

    import java.util.Scanner; public class Solution { public static void main(String[] args) { Scanner i ...

  7. HW2.21

    import java.util.Scanner; public class Solution { public static void main(String[] args) { Scanner i ...

  8. HW2.20

    import java.util.Scanner; public class Solution { public static void main(String[] args) { Scanner i ...

  9. HW2.19

    public class Solution { public static void main(String[] args) { char outcome; long randomNumber; wh ...

  10. HW2.18

    public class Solution { public static void main(String[] args) { System.out.println("a" + ...

随机推荐

  1. can't add foreign key in mysql?

    create table department (dept_name ), building ), budget numeric(,) ), primary key (dept_name) ); cr ...

  2. hdu 3746 Cyclic Nacklace KMP循环节

    Cyclic Nacklace 题意:给一个长度为Len( 3 <= Len <= 100000 )的英文串,问你在字符串后面最少添加几个字符可以使得添加后的串为周期串? Sample I ...

  3. Educational Codeforces Round 7 F - The Sum of the k-th Powers 拉格朗日插值

    The Sum of the k-th Powers There are well-known formulas: , , . Also mathematicians found similar fo ...

  4. Ubuntu Vim YouCompleteMe 安装

    0. 必要工具安装 sudo apt-get install build-essential cmake 1. 安装 vundle mkdir ~/.vim/bundle git clone http ...

  5. Shell编程练习

    1.使用case语句 2.使用while....do....done语句 3.使用

  6. py2exe把python程序转换exe

    1.首先下载py2exe:https://sourceforge.net/projects/py2exe/ 2.假设要打包的python 文件放在C:\packet路径下 如 果你有一个名为myscr ...

  7. RubyCritic:一款不错的检测代码质量工具

    关注代码质量是高效开发必须要做的一件事,那么在 Ruby 开发的过程中,是否有什么好的代码质量检测工具呢?下面由 Ruby 工程师路英瑞介绍一下 RubyCritic--一款还不错的代码质量检测工具. ...

  8. flash 类和对象的关系

    每个具体的对象后面都隐藏着抽象的类. flash 中as3.0中所有的类,都是为了创建对象所用的.反过来,所创建的任何具体对象都隐藏着抽象的类. 类可以把它看做函数,类的属性是函数的数据,类的方法是函 ...

  9. [unity菜鸟] controller.SimpleMove(transform .forward); 无法移动

    今天做demo时遇到一个问题:当使用角色控制器操作物体,用 controller.SimpleMove(transform .forward); 语句时物体不能移动,搜索请教了很久,最后终于googl ...

  10. 判断微信内置浏览器的UserAgent

    要区分用户是通过"微信内置浏览器"还是"原生浏览器"打开的WebApp, 可以通过navigator.userAgent来进行判断. 以下是对各种平台上微信内置 ...