daily pastebin goal
74%
SHARE
TWEET

Untitled

a guest Jan 19th, 2019 59 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. package project1;
  2. import java.util.Scanner;
  3. import java.text.DecimalFormat;
  4.  
  5. public class Class1 {
  6.     public static void main(String[] args){
  7. Scanner inputData = new Scanner(System.in);
  8. DecimalFormat convertDecimals = new DecimalFormat("#0.00");
  9.  
  10.      String name;
  11.         int timeWorked;
  12.         float saleryPerHour;
  13.         float totalSalery;
  14.      
  15.        
  16.         System.out.println("Josefin");
  17.         name = inputData.nextLine();
  18.         System.out.println("150 kr");
  19.         saleryPerHour = inputData.nextFloat();
  20.         System.out.println("160 h");
  21.         timeWorked = inputData.nextInt();
  22.         totalSalery = saleryPerHour * timeWorked;
  23.         String totalSaleryConverted = convertDecimals.format(totalSalery);
  24.         System.out.println(name + "du tjänade" + totalSaleryConverted + " kronor denna månaden.");
  25.        
  26.        
  27.     }
  28.    }
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