Package java.util

Examples of java.util.Scanner.nextDouble()


      scanner.next();
      double defense = scanner.nextDouble();
      scanner.next();
      double base = scanner.nextDouble();
      scanner.next();
      double stab = scanner.nextDouble();
      scanner.next();
      double critical = scanner.nextDouble();
      scanner.next();
      double random = scanner.nextDouble();
     
View Full Code Here


      scanner.next();
      double base = scanner.nextDouble();
      scanner.next();
      double stab = scanner.nextDouble();
      scanner.next();
      double critical = scanner.nextDouble();
      scanner.next();
      double random = scanner.nextDouble();
     
      int damage = (int)((((2.0 * level + 10) / 250) * (attack/defense) * base + 2)
        * stab * type * critical * random);
 
View Full Code Here

      scanner.next();
      double stab = scanner.nextDouble();
      scanner.next();
      double critical = scanner.nextDouble();
      scanner.next();
      double random = scanner.nextDouble();
     
      int damage = (int)((((2.0 * level + 10) / 250) * (attack/defense) * base + 2)
        * stab * type * critical * random);
       
      output.println(damage);
 
View Full Code Here

public class Lab5Ex1{
  public static void main(String[] args){
    System.out.print("Welcome to Bill Calculator!");
    Scanner keyboard = new Scanner(System.in);
    System.out.print("Price of the appetizer? ");
    double app = keyboard.nextDouble();
    System.out.print("Price of the main dish? ");
    double entre = keyboard.nextDouble();
    System.out.print("Price of the desert? ");
    double desert = keyboard.nextDouble();
    System.out.print("Tip rate? ");
View Full Code Here

    System.out.print("Welcome to Bill Calculator!");
    Scanner keyboard = new Scanner(System.in);
    System.out.print("Price of the appetizer? ");
    double app = keyboard.nextDouble();
    System.out.print("Price of the main dish? ");
    double entre = keyboard.nextDouble();
    System.out.print("Price of the desert? ");
    double desert = keyboard.nextDouble();
    System.out.print("Tip rate? ");
    double tipRate = keyboard.nextDouble();
    double subtotal = app + entre + desert;
View Full Code Here

    System.out.print("Price of the appetizer? ");
    double app = keyboard.nextDouble();
    System.out.print("Price of the main dish? ");
    double entre = keyboard.nextDouble();
    System.out.print("Price of the desert? ");
    double desert = keyboard.nextDouble();
    System.out.print("Tip rate? ");
    double tipRate = keyboard.nextDouble();
    double subtotal = app + entre + desert;
    double tax = subtotal * 15 / 100;
    double tip = subtotal * tipRate / 100;
View Full Code Here

    System.out.print("Price of the main dish? ");
    double entre = keyboard.nextDouble();
    System.out.print("Price of the desert? ");
    double desert = keyboard.nextDouble();
    System.out.print("Tip rate? ");
    double tipRate = keyboard.nextDouble();
    double subtotal = app + entre + desert;
    double tax = subtotal * 15 / 100;
    double tip = subtotal * tipRate / 100;
    System.out.println("\nSubtotal: "+ subtotal );
    System.out.println("Tax: "+ tax );
View Full Code Here

import java.util.Scanner;
public class Lab5Ex2{
  public static void main(String[] args){
    Scanner keyboard = new Scanner(System.in);
    System.out.print("Please input the first double ");
    double n1 = keyboard.nextDouble();
    System.out.print("Please input the second double ");
    double n2 = keyboard.nextDouble();
    System.out.print("Please input the third double ");
    double n3 = keyboard.nextDouble();
    System.out.print("The sum of "+ n1 + " and " + n2 + " is " + (n1+n2) + " which is");
View Full Code Here

  public static void main(String[] args){
    Scanner keyboard = new Scanner(System.in);
    System.out.print("Please input the first double ");
    double n1 = keyboard.nextDouble();
    System.out.print("Please input the second double ");
    double n2 = keyboard.nextDouble();
    System.out.print("Please input the third double ");
    double n3 = keyboard.nextDouble();
    System.out.print("The sum of "+ n1 + " and " + n2 + " is " + (n1+n2) + " which is");
    if ( n1+n2 <= n3) {
      System.out.print(" not");
View Full Code Here

    System.out.print("Please input the first double ");
    double n1 = keyboard.nextDouble();
    System.out.print("Please input the second double ");
    double n2 = keyboard.nextDouble();
    System.out.print("Please input the third double ");
    double n3 = keyboard.nextDouble();
    System.out.print("The sum of "+ n1 + " and " + n2 + " is " + (n1+n2) + " which is");
    if ( n1+n2 <= n3) {
      System.out.print(" not");
      }
    System.out.print(" greater than "+ n3 );
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.