Guest User

Untitled

a guest
Sep 23rd, 2018
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.62 KB | None | 0 0
  1. package Lesson_5_6.Task1_AirlineTicket;
  2.  
  3. public class Baggage {
  4. private int bagquant;
  5. private double bagprice;
  6.  
  7. public Baggage(int bagquant, double bagprice) {
  8. this.bagquant = bagquant;
  9. this.bagprice = bagprice;
  10. }
  11.  
  12. public int getPrice(){
  13. return (int) (bagprice * bagquant);
  14. }
  15.  
  16. public int getBagquant() {
  17. return bagquant;
  18. }
  19.  
  20. public double getBagprice() {
  21. return bagprice;
  22. }
  23.  
  24. @Override
  25. public String toString() {
  26. return "Baggage{" +
  27. "bagquant=" + bagquant +
  28. ", bagprice=" + bagprice +
  29. '}';
  30. }
  31. }
Add Comment
Please, Sign In to add comment