数组练习
建立房间类数组Room[] rooms,Room对象包含房间号、房间类型、状态三种属性
具有订房、退房、查看房间状态功能
//测试程序
package com.jl.learning;
import java.util.Scanner;
public class ArrayTest8 {
public static void main(String[] args) {
Hotel hotel = new Hotel();
System.out.println("欢迎使用系统,请阅读以下的说明");
System.out.println("功能编号对应功能:1.查看房间列表;2.订房;3.退房;0.退出系统");
Scanner s = new Scanner(System.in);
while(true){
//while死循环保证程序不退出,变量值不重置,能持续操作
System.out.println("请输入功能编号:");
int i = s.nextInt();
if(i==1){
hotel.printCondition();
}else if(i==2){
System.out.println("请输入房号:");
int roomNo = s.nextInt();
hotel.reservation(roomNo);
}else if(i==3){
System.out