Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package javaapplication.pkg7.pkg6;
- import java.util.Scanner;
- /**
- *
- * @author adaab01
- */
- public class JavaApplication76 {
- /**
- * @param args the command line arguments
- */
- public static void main(String[] args) {
- Scanner scan = new Scanner(System.in);
- System.out.println("Mata in brevets vikt: ");
- double vik = scan.nextDouble();
- double porto;
- if (vik <= 20 ){
- porto = 5;
- }
- else if (vik <= 100){
- porto = 10;
- }
- else{
- porto = 20;
- }
- System.out.println("Ett brev som väger " + vik + "gram kostar " + porto + "kronor.");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement