Advertisement
skipter

Fishland - Exam 20 Nov

Apr 29th, 2017
142
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.83 KB | None | 0 0
  1. import java.util.Scanner;
  2. public class Main {
  3.     public static void main(String[] args) {
  4.  
  5.         Scanner input = new Scanner(System.in);
  6.  
  7.         double skumriqPrice = Double.parseDouble(input.nextLine());
  8.         double cacaPrice = Double.parseDouble(input.nextLine());
  9.         double palamudKilos = Double.parseDouble(input.nextLine());
  10.         double safridKilos = Double.parseDouble(input.nextLine());
  11.         int midiKilos  = Integer.parseInt(input.nextLine());
  12.  
  13.         double palamudRealPrice = skumriqPrice + skumriqPrice * 0.60;
  14.         double safridPrice = cacaPrice + cacaPrice * 0.80;
  15.         double midiPrice = 7.50;
  16.  
  17.         double totalPrice = (midiKilos * midiPrice) + (safridKilos * safridPrice) + (palamudRealPrice * palamudKilos);
  18.         System.out.printf("%.2f", totalPrice);
  19.  
  20.  
  21.  
  22.  
  23.  
  24.  
  25.        
  26.  
  27.     }
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement