veronikaaa86

WireNet

Jan 20th, 2018
290
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.80 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class SomeExample {
  4.     public static void main(String[] args) {
  5.         Scanner scanner = new Scanner(System.in);
  6.  
  7.         int lengthYard = Integer.parseInt(scanner.nextLine());
  8.         int widthYard = Integer.parseInt(scanner.nextLine());
  9.         double heightNet = Double.parseDouble(scanner.nextLine());
  10.         double priceNet = Double.parseDouble(scanner.nextLine());
  11.         double weightSqM = Double.parseDouble(scanner.nextLine());
  12.  
  13.         int perimeter = lengthYard * 2 + widthYard * 2;
  14.         double totalPriceNet = perimeter * priceNet;
  15.         double totalWeght = perimeter * heightNet * weightSqM;
  16.  
  17.         System.out.printf("%d%n", perimeter);
  18.         System.out.printf("%.2f%n", totalPriceNet);
  19.         System.out.printf("%.3f", totalWeght);
  20.     }
  21. }
Advertisement
Add Comment
Please, Sign In to add comment