Advertisement
Guest User

Untitled

a guest
Jan 22nd, 2018
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.75 KB | None | 0 0
  1. package javaapplication.pkg7.pkg6;
  2. import java.util.Scanner;
  3.  
  4. /**
  5.  *
  6.  * @author adaab01
  7.  */
  8. public class JavaApplication76 {
  9.  
  10.     /**
  11.      * @param args the command line arguments
  12.      */
  13.     public static void main(String[] args) {
  14.        
  15.     Scanner scan = new Scanner(System.in);  
  16.         System.out.println("Mata in brevets vikt: ");  
  17.          double vik = scan.nextDouble();    
  18.          double porto;
  19.          
  20.         if (vik <= 20 ){
  21.             porto = 5;
  22.         }
  23.         else if (vik <= 100){
  24.             porto = 10;
  25.         }
  26.         else{
  27.             porto = 20;
  28.         }
  29.  
  30.                 System.out.println("Ett brev som väger " + vik + "gram kostar " + porto + "kronor.");  
  31.  
  32.        
  33.        
  34.     }
  35.    
  36. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement