Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package Lesson_5_6.Task1_AirlineTicket;
- public class Baggage {
- private int bagquant;
- private double bagprice;
- public Baggage(int bagquant, double bagprice) {
- this.bagquant = bagquant;
- this.bagprice = bagprice;
- }
- public int getPrice(){
- return (int) (bagprice * bagquant);
- }
- public int getBagquant() {
- return bagquant;
- }
- public double getBagprice() {
- return bagprice;
- }
- @Override
- public String toString() {
- return "Baggage{" +
- "bagquant=" + bagquant +
- ", bagprice=" + bagprice +
- '}';
- }
- }
Add Comment
Please, Sign In to add comment