Advertisement
stornup

1st_class

Jan 19th, 2020
176
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.89 KB | None | 0 0
  1. /*
  2.  * To change this license header, choose License Headers in Project Properties.
  3.  * To change this template file, choose Tools | Templates
  4.  * and open the template in the editor.
  5.  */
  6. package javaclassproject;
  7.  
  8. /**
  9.  *
  10.  * @author storn
  11.  */
  12. public class FirstClass {
  13.     public String StoreName;
  14.     public int BoxPrice;
  15.     public int OneBoxArea;
  16.    
  17.     FirstClass(String storeName, int boxPrice, int oneBoxArea){
  18.         StoreName = storeName;
  19.         BoxPrice = boxPrice;
  20.         OneBoxArea = oneBoxArea;
  21.     }
  22.    
  23.     public static int CostWithoutDelivery(int price, int area){
  24.         int neededBoxes = 108/area;
  25.         int procent = (neededBoxes * 15) / 100;
  26.         int cost = price * (neededBoxes + procent);
  27.         return cost;
  28.     }
  29.    
  30.     public static void ShowResult(int result){
  31.         System.out.println("С вас " + result + " рублей");
  32.     }
  33. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement