⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 trip.java

📁 Java program for making trip reservations.
💻 JAVA
字号:

public class Trip {
	
	private String destination;
	private double nights;
	private double transport;
	private double food;
	private double others;
	private double days;
	private int passengers;
	
	public Trip(String destination, double nights, double transport, double food, double others, double days, int passengers) {
		super();
		this.destination = destination;
		this.nights = nights;
		this.transport = transport;
		this.food = food;
		this.others = others;
		this.days = days;
		this.passengers = passengers;
	}

	public Trip(String destination) {
		this.destination=destination;
		this.setDays(days);
		this.setFood(food);
		this.setNights(nights);
		this.setOthers(others);
		this.setPassengers(passengers);
		this.setTransport(transport);
	}
	public Trip(){
		
	}

	public double getDays() {
		return days;
	}

	public void setDays(double days) {
		this.days = days;
	}

	public String getDestination() {
		return destination;
	}

	public void setDestination(String destination) {
		this.destination = destination;
	}

	public double getFood() {
		return food;
	}

	public void setFood(double food) {
		this.food = food;
	}

	public double getNights() {
		return nights;
	}

	public void setNights(double nights) {
		this.nights = nights;
	}

	public double getOthers() {
		return others;
	}

	public void setOthers(double others) {
		this.others = others;
	}

	public int getPassengers() {
		return passengers;
	}

	public void setPassengers(int passengers) {
		this.passengers = passengers;
	}

	public double getTransport() {
		return transport;
	}

	public void setTransport(double transport) {
		this.transport = transport;
	}
	
	public double getPricePerDay() {
		double prPerDay=getNights()+getFood()+getOthers();
		return prPerDay;
	}
	public double getWholePrice() {
		double wholePrice=(getTransport()+getPricePerDay()*getDays())*getPassengers();
		return wholePrice;
	}
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -