daily pastebin goal
61%
SHARE
TWEET

Untitled

a guest May 16th, 2018 79 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import java.io.Console;
  2. import java.util.Scanner;
  3. public class EmployeeData {
  4.  
  5.         public static void main(String[] args) {
  6.  
  7.  
  8.             Scanner console = new Scanner(System.in);
  9.  
  10.             String name = console.nextLine();
  11.             int volume = Integer.parseInt(console.nextLine());
  12.             int energy100 = Integer.parseInt(console.nextLine());
  13.             double sugar100 = Double.parseDouble(console.nextLine());
  14.  
  15.             int energySum = energy100*volume/100;
  16.             double sugarSum = sugar100*volume/100;
  17.  
  18.             System.out.printf("%dml %s:%n%dkcal, %.0fg sugars",volume, name, energySum, sugarSum);
  19.  
  20.  
  21.         }
  22.     }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top